Class: Auditing::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Auditing::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/auditing/install_generator.rb
Instance Method Summary collapse
- #create_controller_files ⇒ Object
- #create_helper_files ⇒ Object
- #create_initializer ⇒ Object
- #create_migration ⇒ Object
- #create_model_files ⇒ Object
- #create_routes ⇒ Object
- #create_view_files ⇒ Object
Instance Method Details
#create_controller_files ⇒ Object
11 12 13 |
# File 'lib/generators/auditing/install_generator.rb', line 11 def create_controller_files template 'audits_controller.rb', 'app/controllers/audits_controller.rb' end |
#create_helper_files ⇒ Object
15 16 17 |
# File 'lib/generators/auditing/install_generator.rb', line 15 def create_helper_files template 'audits_helper.rb', 'app/helpers/audits_helper.rb' end |
#create_initializer ⇒ Object
36 37 38 |
# File 'lib/generators/auditing/install_generator.rb', line 36 def create_initializer template 'auditing.rb', 'config/initializers/auditing.rb' end |
#create_migration ⇒ Object
32 33 34 |
# File 'lib/generators/auditing/install_generator.rb', line 32 def create_migration migration_template 'migration.rb', "db/migrate/create_audits.rb" end |
#create_model_files ⇒ Object
19 20 21 |
# File 'lib/generators/auditing/install_generator.rb', line 19 def create_model_files template 'audit.rb', 'app/models/audit.rb' end |
#create_routes ⇒ Object
27 28 29 30 |
# File 'lib/generators/auditing/install_generator.rb', line 27 def create_routes route "match ':resource/:id/audits' => 'audits#index', :as => 'audits'" route "match 'audit/rollback/:id' => 'audits#rollback', :as => 'audit_rollback'" end |
#create_view_files ⇒ Object
23 24 25 |
# File 'lib/generators/auditing/install_generator.rb', line 23 def create_view_files template 'index.html.erb', 'app/views/audits/index.html.erb' end |