Class: AdminResourceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- AdminResourceGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/admin_resource_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_controller_file ⇒ Object
5 6 7 |
# File 'lib/generators/admin_resource_generator.rb', line 5 def create_controller_file template "admin_resource/controller.rb", File.join("app/controllers/admin/", "#{controller_file_name}_controller.rb") end |
#create_decorator_file ⇒ Object
9 10 11 |
# File 'lib/generators/admin_resource_generator.rb', line 9 def create_decorator_file template "admin_resource/decorator.rb", File.join("app/decorators/", "#{singular_name}_decorator.rb") end |
#create_view_file ⇒ Object
13 14 15 |
# File 'lib/generators/admin_resource_generator.rb', line 13 def create_view_file copy_file "admin_resource/views/_form.html.erb", "app/views/admin/#{plural_name}/_form.html.erb" end |