No commit activity in last 3 years
No release in over 3 years
'application_config' eases project configuring by introducing erb enabled yaml config file in RAILS_ROOT/config folder and provides handful methods accessing config values based on current rails environment. So, you can have separate sets of configuration properties for each rails environment you use.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

application_config functionality¶ ↑

‘application_config’ eases project configuring by introducing erb enabled yaml config file in RAILS_ROOT/config folder and provides handful methods accessing config values based on current rails environment. So, you can have separate sets of configuration properties for each rails environment you use.

Installation¶ ↑

gem “cleverua_application_config”, “~> 2.0”, :require => “application_config”

Then run:

rails generate application_config:install

Default configuration file¶ ↑

During installation plugin will create default config in RAILS_ROOT/config/application_config.yml, it looks like the following (please note it’s okay to put ERB tags in there)

development: &defaults
  items_per_page: 25
  secure_with_basic_auth: false
  base_url: development.com
  erb_enabled_property: <%= "#{Rails.root}/something" %>
test:
  <<: *defaults
  base_url: test.com
production:
  <<: *defaults
  base_url: production.com

Usage¶ ↑

You then can access those values using ‘property’ method:

class FooController < ApplicationController
  def index
    @base_url = property(:base_url)
  end
end

This will set @base_url with value ‘development.com’ if you run that in development environment.