Class: Mapfish::PrintControllerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Mapfish::PrintControllerGenerator
- Defined in:
- lib/generators/mapfish/print_controller/print_controller_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
5 6 7 |
# File 'lib/generators/mapfish/print_controller/print_controller_generator.rb', line 5 def self.source_root @source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#add_routes ⇒ Object
17 18 19 20 21 |
# File 'lib/generators/mapfish/print_controller/print_controller_generator.rb', line 17 def add_routes route %{match '#{file_name}/:id.:format' => "#{file_name}#show", :via => :get} route %{match '#{file_name}/create.:format' => "#{file_name}#create", :via => :post} route %{match '#{file_name}/info.:format' => "#{file_name}#info", :via => :get} end |
#create_config_files ⇒ Object
13 14 15 |
# File 'lib/generators/mapfish/print_controller/print_controller_generator.rb', line 13 def create_config_files template 'config.yaml', File.join('config', class_path, "print.yaml") end |
#create_controller_files ⇒ Object
9 10 11 |
# File 'lib/generators/mapfish/print_controller/print_controller_generator.rb', line 9 def create_controller_files template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb") end |