My favorites | Sign in
Project Logo
       
Code license: MIT License
Labels: rails, configuration, plugin
Feeds:
People details
Project owners:
  pavlikus

Plugin functionality

'application_config' eases project configuring by introducing 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.

SVN Repository

http://application-config.googlecode.com/svn/

Installation

> ruby ./script/plugin install http://application-config.googlecode.com/svn/tags/application-config

Default configuration file

During installation, plugin will create default config in RAILS_ROOT/config/application_config.yml, it looks like the following:

  development: &defaults
    items_per_page: 25
    secure_with_basic_auth: false
    base_url: development.com
  test:
    <<: *defaults
    base_url: test.com
  production:
    <<: *defaults
    base_url: production.com

Usage

You then can get those values using 'property' method:

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

This will set @items_per_page with value 'development.com' if you run that in development environment.

Copyright & License

Copyright (c) 2008 Pavlo Lysov, released under the MIT license









Hosted by Google Code