Class: Optimacms::DevController

Inherits:
ApplicationController show all
Defined in:
app/controllers/optimacms/dev_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_lang, #not_found

Methods included from ApplicationHelper

#block, #meta_tags, #method_missing, #site_page_path, #tinymce_editor_insert_block

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Optimacms::ApplicationHelper

Instance Method Details

#addadminuserObject



26
27
28
29
30
31
32
33
34
# File 'app/controllers/optimacms/dev_controller.rb', line 26

def addadminuser
  return

  row = Optimacms::CmsAdminUser.new
  row.email = '[email protected]'
  row.password = 'admin'

  row.save
end

#check_envObject



6
7
8
# File 'app/controllers/optimacms/dev_controller.rb', line 6

def check_env
  return false unless Rails.env.development?
end

#fileObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/optimacms/dev_controller.rb', line 10

def file
  from = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/files/1/cat_red.jpg'
  to = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/files/1/supercat.jpg'

  f = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/uploads/funny-cats-and-kittens-wallpapers-12.jpg'


  #FileUtils.move(from, to)

  require 'pathname'
  p = Pathname.new(f)
  p.unlink

  #FileUtils.rm(f)
end