Class: Edgarj::PopupScaffoldGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Edgarj::PopupScaffoldGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
Instance Method Summary collapse
- #add_edgarj_routes ⇒ Object
- #create_controller_files ⇒ Object
- #create_helper ⇒ Object
-
#create_test ⇒ Object
hook_for :test_framework, as: :popup_scaffold hook_for :helper, in: :rails, as: :popup_scaffold do |invoked| invoke invoked, [ controller_name ] end.
Instance Method Details
#add_edgarj_routes ⇒ Object
9 10 11 |
# File 'lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb', line 9 def add_edgarj_routes route "edgarj_popup_resources :#{file_name.pluralize}_popup" end |
#create_controller_files ⇒ Object
13 14 15 16 |
# File 'lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb', line 13 def create_controller_files template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_popup_controller.rb") end |
#create_helper ⇒ Object
30 31 32 33 |
# File 'lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb', line 30 def create_helper template 'helper.rb', File.join('app/helpers', class_path, "#{controller_file_name}_popup_helper.rb") end |
#create_test ⇒ Object
hook_for :test_framework, as: :popup_scaffold
hook_for :helper, in: :rails, as: :popup_scaffold do |invoked|
invoke invoked, [ controller_name ]
end
25 26 27 28 |
# File 'lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb', line 25 def create_test template 'functional_test.rb', File.join('test/functional', class_path, "#{controller_file_name}_popup_controller_test.rb") end |