I recently edited Rail''s in_place_editor javascript helper along with Scriptaculous'' inPlaceEditor javascript so that it will accept double or single clicks (via :double_click => true, if you''re interested). The only thing I''m worried about is now I have a custom version of Rails running on my local machine, since I edited the actionpack helper file directly. Is there anyway to extend the one class Rails which contains the helper instead of having to worry about a custom Rails file living in the depths of the Rails installation, and then put this extension in my application somewhere where it won''t get overwritten on rails updates? -- 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 -~----------~----~----~----~------~----~------~--~---
Nate wrote:> I recently edited Rail''s in_place_editor javascript helper along with > Scriptaculous'' inPlaceEditor javascript so that it will accept double or > single clicks (via :double_click => true, if you''re interested). The > only thing I''m worried about is now I have a custom version of Rails > running on my local machine, since I edited the actionpack helper file > directly. Is there anyway to extend the one class Rails which contains > the helper instead of having to worry about a custom Rails file living > in the depths of the Rails installation, and then put this extension in > my application somewhere where it won''t get overwritten on rails > updates?You can do just about anything you''d need to do in a plugin. Extract your mods and package them up as a module that you use to monkey-patch the class in the Rails component. You can see an example of how to do that in a plugin here: http://svn.hasmanythrough.com/public/plugins/dynamic_finders_with_belongs_to_names/ -- Josh Susser http://blog.hasmanythrough.com -- 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 -~----------~----~----~----~------~----~------~--~---
you can also just create ruby files in the lib folder of your rails app, and these will be loaded up with application. you can put a class in there with the same name as the helper class you''re changing and put the modified method in, then that''ll be used instead. Josh Susser wrote:> Nate wrote: > >> I recently edited Rail''s in_place_editor javascript helper along with >> Scriptaculous'' inPlaceEditor javascript so that it will accept double or >> single clicks (via :double_click => true, if you''re interested). The >> only thing I''m worried about is now I have a custom version of Rails >> running on my local machine, since I edited the actionpack helper file >> directly. Is there anyway to extend the one class Rails which contains >> the helper instead of having to worry about a custom Rails file living >> in the depths of the Rails installation, and then put this extension in >> my application somewhere where it won''t get overwritten on rails >> updates? >> > > You can do just about anything you''d need to do in a plugin. Extract > your mods and package them up as a module that you use to monkey-patch > the class in the Rails component. You can see an example of how to do > that in a plugin here: > http://svn.hasmanythrough.com/public/plugins/dynamic_finders_with_belongs_to_names/ > > -- > > Josh Susser > http://blog.hasmanythrough.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 -~----------~----~----~----~------~----~------~--~---