Class: Analytics::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Analytics::Generators::InstallGenerator
- Defined in:
- lib/generators/analytics_generator.rb
Instance Method Summary collapse
- #add_analytics_route ⇒ Object
- #create_analytics_controller ⇒ Object
- #create_analytics_view ⇒ Object
- #create_migration_file ⇒ Object
- #create_model_file ⇒ Object
Instance Method Details
#add_analytics_route ⇒ Object
17 18 19 |
# File 'lib/generators/analytics_generator.rb', line 17 def add_analytics_route route "get 'analytics', to: 'analytics#index'" end |
#create_analytics_controller ⇒ Object
9 10 11 |
# File 'lib/generators/analytics_generator.rb', line 9 def create_analytics_controller template "analytics_controller.rb", "app/controllers/analytics_controller.rb" end |
#create_analytics_view ⇒ Object
13 14 15 |
# File 'lib/generators/analytics_generator.rb', line 13 def create_analytics_view template "index.html.erb.tt", "app/views/analytics/index.html.erb" end |
#create_migration_file ⇒ Object
25 26 27 28 |
# File 'lib/generators/analytics_generator.rb', line 25 def create_migration_file = Time.now.utc.strftime("%Y%m%d%H%M%S") template "migration.rb", "db/migrate/#{timestamp}_create_analytics.rb" end |
#create_model_file ⇒ Object
21 22 23 |
# File 'lib/generators/analytics_generator.rb', line 21 def create_model_file template "analytic.rb", "app/models/analytic.rb" end |