Plugins - application_config

StarAdd to favorites

application_config 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

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 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.

Copyright & License

Copyright © 2008 Pavlo Lysov, released under the MIT license

Pavlikus

http://application-config.googlecode.com

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

Rails' (MIT)

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment
Victor Brylew 2 Sep 2008

Perfect plugin that does exactly what is needed and makes it in very simple way.

Victor Brylew 12 Aug 2008

Thanks. Very useful and POLS plugin.

Norman Clarke 13 Jun 2008

I posted more or less the exact same thing several months ago, except it's a generator rather than a plugin. If you want we could probably find some way to merge them together since I don't think the world needs two separate projects that do almost the exact same thing.

http://randomba.org/index.php/2008/01/03/application-config-generator-for-rails/

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?