Class: Stationary::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Stationary::Generators::InstallGenerator
- Defined in:
- lib/generators/stationary/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_routes ⇒ Object
18 19 20 21 22 |
# File 'lib/generators/stationary/install_generator.rb', line 18 def add_routes log :route, 'Stationary Route Insert' sentinel = /^end$/ inject_into_file 'config/routes.rb', "\n root :to => Stationary::Engine\n match '/:path(.:format)', :to => Stationary::Engine, :constraints => { :path => /.+?/ }\n\n", { :before => sentinel, :verbose => true } end |
#create_initializer_file ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/stationary/install_generator.rb', line 5 def create_initializer_file create_file "config/initializers/stationary.rb" do <<-TXT # The example below shows how to configure Stationary to allow public # access to the pages behind devise and also set the root directory for # Stationary to look for template files. #Stationary.configure do |config| # config.root = "\#{Rails.root}/app/views/site" # config.skip_before_filter = :authenticate_user! #end TXT end end |