Hi, 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''] Proc.new do |data| node = REXML::Document.new data { node.root.name => node.root } end (got this example from e.g. http://www.linuxjournal.com/article/8968, 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 applications. On May 1, 11:30 am, dt <dayt...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > 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''] > Proc.new do |data| > node = REXML::Document.new data > { node.root.name => node.root } > end > > (got this example from e.g.http://www.linuxjournal.com/article/8968, > 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.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 anything Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---