Configuration

  • Put custom initialization code in config/initializers. The code in initializers executes on application startup.

  • Keep initialization code for each gem in a separate file with the same name as the gem, for example carrierwave.rb, active_admin.rb, etc.

  • Adjust accordingly the settings for development, test and production environment (in the corresponding files under config/environments/)

  • Mark additional assets for precompilation (if any):

    # config/environments/production.rb
    # Precompile additional assets (application.js, application.css,
    #and all non-JS/CSS are already added)
    config.assets.precompile += %w( rails_admin/rails_admin.css rails_admin/rails_admin.js )
    
  • Keep configuration that's applicable to all environments in the config/application.rb file.

  • Create an additional staging environment that closely resembles the production one.

  • Keep any additional configuration in YAML files under the config/ directory.

    Since Rails 4.2 YAML configuration files can be easily loaded with the new config_for method:

    Rails::Application.config_for(:yaml_file)
    

results matching ""

    No results matching ""