Class: Trestle::Generators::ResourceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Trestle::Generators::ResourceGenerator
- Defined in:
- lib/generators/trestle/resource/resource_generator.rb
Instance Method Summary collapse
Instance Method Details
#admin_name ⇒ Object
14 15 16 |
# File 'lib/generators/trestle/resource/resource_generator.rb', line 14 def admin_name singular? ? singular_name : plural_name end |
#create_admin ⇒ Object
10 11 12 |
# File 'lib/generators/trestle/resource/resource_generator.rb', line 10 def create_admin template "admin.rb.erb", File.join("app/admin", class_path, "#{admin_name}_admin.rb") end |
#parameter_name ⇒ Object
18 19 20 |
# File 'lib/generators/trestle/resource/resource_generator.rb', line 18 def parameter_name singular_name.singularize end |
#singular? ⇒ Boolean
22 23 24 |
# File 'lib/generators/trestle/resource/resource_generator.rb', line 22 def singular? [:singular] end |