Class: Resourceable::Generators::ResourceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Resourceable::Generators::ResourceGenerator
- Defined in:
- lib/generators/resourceable/resource_generator.rb
Instance Method Summary collapse
Instance Method Details
#controller ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/resourceable/resource_generator.rb', line 12 def controller generate 'controller', name.titleize.pluralize puts "app/controllers/#{name.downcase.pluralize}_coontroller.rb" puts "#{name.titleize.pluralize}Controller" inject_into_class controller_path, controller_name, "\tcrud permitted: #{attribute_keys}\n" end |
#model ⇒ Object
8 9 10 |
# File 'lib/generators/resourceable/resource_generator.rb', line 8 def model generate 'model', "#{name} #{}" end |