Forum: Ruby on Rails Where is global Rails configuration?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
39826054fc1522fb50558be9906af286?d=identicon&s=25 dt (Guest)
on 2007-05-01 17:31
(Received via mailing list)

Let's say I wanted to add something to Rails that I would like all
applications to use. For example, I would like to add the pluggable
parameter parsing using:

ActionController::Base.param_parsers['application/atom+xml'] = do |data|
  node = data
  { => node.root }

(got this example from e.g.,
but it's also in the source code). I would not like this to be related
to a specific controller or application - I would like to add it for
all applications at once. In this case, it would be for both already
existing applications and the ones I create. What is the appropriate
place for this (if any)? I know that editing environment.rb is a good
place for per-application settings.

Yes, another (relatively simple) way would be to just 'require' the
Ruby file with these settings in all applicaitons, but I am just
curious if there is some standard way of doing this.
21f7ed21f11a809050594c82eab11d67?d=identicon&s=25 Robert Walker (Guest)
on 2007-05-01 18:16
(Received via mailing list)
I would say the appropriate place for this would be in a plugin.
Doing anything else would mean modifying the Rails core code, which
I'm guessing would violate your Rails open source license agreement
(unless you're a Rails contributor).  Basically, if you modify Rails
it won't be Rails anymore.

Rails is kind enough to offer a plug-in architecture where you should
be able to do what you want and include it into all or your
153868096910b6bca47e2a9212c2df56?d=identicon&s=25 Frederick Cheung (fcheung)
on 2007-05-01 18:26
A plugin is probably the way to go, but there's nothing wrong from the
point of view of licensing with fiddling with the core code - Rails is
distributed under the MIT license which allows you to do pretty much

This topic is locked and can not be replied to.