#Setting up SettingsLogic on Rails 3
In the Gemfile
gem 'settingslogic'
Run bundler
bundler install
Create the initializer file as config/initializers/app_settings.rb
class Settings < Settingslogic
source "#{Rails.root}/config/settings.yml"
namespace Rails.env
end
Note: you need to name file app_settings.rb
so that the file loads alphabetically in rails first amongst the initializers
Create the settings file as config/settings.yml
defaults: &defaults
app:
name: "App Name"
server: "Default"
test:
<<: *defaults
app:
server: "Test"
development:
<<: *defaults
app:
server: "Development"
production:
<<: *defaults
app:
server: "Production"