Class: ActsAsPublicable::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActsAsPublicable::Generators::InstallGenerator
- Defined in:
- lib/generators/acts_as_publicable/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_route ⇒ Object
18 19 20 21 |
# File 'lib/generators/acts_as_publicable/install_generator.rb', line 18 def add_route route "put '/#{name.underscore.pluralize}/:id/:type' => '#{name.underscore.pluralize}#publish', :as => :publishable" route "acts_as_publicable :#{name.underscore.singularize}" end |
#copy_controller ⇒ Object
10 11 12 |
# File 'lib/generators/acts_as_publicable/install_generator.rb', line 10 def copy_controller template "controller.rb", "app/controllers/#{name.underscore}_controller.rb" end |
#copy_helper ⇒ Object
14 15 16 |
# File 'lib/generators/acts_as_publicable/install_generator.rb', line 14 def copy_helper template "helper.rb", "app/helpers/#{name.underscore}_helper.rb" end |