12 Sep '12, 2am

ruby - Accessing config from application.rb in Controller (Rails 3) - Stack Overflow:

I believe you've got a slightly incorrect idea behind what your expectations for the config/application.rb is providing you. The ActiveRecord::Base and ActiveController::Base eigenclasses use the Rails::Application::Configuration class that is configured in config/application.rb. The attributes aren't available in classes that descend from either of the Base classes, nor their eigenclasses. This is why you are running into errors in ApplicationController. There are generally two ways to make configuration initializations in a Rails app. The first way is to create a configuration module and then load values into it via initializer: First, create a Twiter Config module: #lib/twitter_config.rb module TwitterConfig def config @@config ||= {} end def config=(hash) @@config = hash end end Create a YAML config file: # config/twitter.yaml development: &base key = "foo" secret = "b...

Full article: http://stackoverflow.com/questions/4143638/accessing-conf...

Tweets

Ruby on Rails in NYC with housing and all expen...

careers.stackoverflow.com 10 Sep '12, 12pm

Ruby on Rails in NYC with housing and all expenses paid Intridea New York, NY (relocation offered) ruby-on-rails javascrip...

Ruby on Rails Developer:

findmjob.com 07 Sep '12, 11pm

If you want to make a difference in the lives of people today, come join ATHN and, * Tackle on real problems that will aff...