Class: ParamountGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ParamountGenerator
- Defined in:
- lib/generators/paramount_generator.rb
Instance Method Summary collapse
Instance Method Details
#class_mate ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/generators/paramount_generator.rb', line 16 def class_mate classy = begin Object.const_get(class_name) || Object.const_get( file_name.classify) rescue end end |
#create_controller ⇒ Object
8 9 10 |
# File 'lib/generators/paramount_generator.rb', line 8 def create_controller # template "controller.rb", File.join('app/controllers', class_path, "#{file_name.pluralize}_controller.rb") end |
#create_model_file ⇒ Object
4 5 6 |
# File 'lib/generators/paramount_generator.rb', line 4 def create_model_file template "form.rb", File.join('app/forms', class_path, "#{file_name}_form.rb") end |
#create_view ⇒ Object
12 13 14 |
# File 'lib/generators/paramount_generator.rb', line 12 def create_view template "view.rb", File.join('app/views', class_path, "#{file_name.pluralize}", "_form.html.haml") end |