Class: Hobo::ResourceGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/hobo/resource/resource_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_hobo_controllerObject



12
13
14
# File 'lib/generators/hobo/resource/resource_generator.rb', line 12

def generate_hobo_controller
  invoke 'hobo:controller', [name.pluralize], options
end

#generate_hobo_modelObject



16
17
18
19
20
# File 'lib/generators/hobo/resource/resource_generator.rb', line 16

def generate_hobo_model
  # is there any better way to pass attributes?
  attr = attributes.map{|a| "#{a.name}:#{a.type}"}
  invoke 'hobo:model', [name, attr], options
end