Class: GenController

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jt-mobile-kit/gen_controller/gen_controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ GenController

Returns a new instance of GenController.



6
7
8
9
# File 'lib/jt-mobile-kit/gen_controller/gen_controller.rb', line 6

def initialize(args=[], options={}, config={})
  super
  self.destination_root= ""
end

Instance Method Details

#genObject



13
14
15
16
17
# File 'lib/jt-mobile-kit/gen_controller/gen_controller.rb', line 13

def gen
  controller_name = name
  content = ERB.new File.read("#{GenController.source_root}/controller.js.erb")
  create_file "js/controller/#{controller_name}_controller.js", content.result(binding)
end