Class: SeoLandingPagesGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- SeoLandingPagesGenerator
- Defined in:
- lib/generators/seo_landing_pages_generator.rb
Instance Method Summary collapse
-
#active_admin ⇒ Object
Public: copies the active admin boilerplate code.
-
#admin ⇒ Object
Public: copies the CRUD admin code.
-
#controller ⇒ Object
Public: configures the application controller to include the Helpers module.
-
#i18n ⇒ Object
Public: copies the i18n files.
-
#migration ⇒ Object
Public: copies the migration.
-
#route ⇒ Object
Public: adds an admin route to the router.
Instance Method Details
#active_admin ⇒ Object
Public: copies the active admin boilerplate code.
21 22 23 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 21 def active_admin copy_file 'active_admin.rb', 'app/admin/seo_landing_pages.rb' end |
#admin ⇒ Object
Public: copies the CRUD admin code.
38 39 40 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 38 def admin #TODO end |
#controller ⇒ Object
Public: configures the application controller to include the Helpers module.
14 15 16 17 18 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 14 def controller inject_into_class 'app/controllers/application_controller.rb', ApplicationController do " include SeoLandingPages::Controllers::Helpers\n\n" end end |
#i18n ⇒ Object
Public: copies the i18n files.
26 27 28 29 30 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 26 def i18n %w(en es).each do |locale| copy_file "i18n.#{ locale }.yml", "config/locales/seo_landing_pages.#{ locale }.yml" end end |
#migration ⇒ Object
Public: copies the migration.
9 10 11 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 9 def migration migration_template 'migration.rb', 'db/migrate/create_seo_landing_pages.rb' end |
#route ⇒ Object
Public: adds an admin route to the router.
33 34 35 |
# File 'lib/generators/seo_landing_pages_generator.rb', line 33 def route #TODO end |