On Sep 10, 2009, at 11:53 PM, Andrew Pace wrote: > I am trying to keep my code organized as a project grows larger. I am > having trouble organizing helpers into a way that I like. Right now, > I have helpers named after the controllers and one application > helper. I am trying not to duplicate any code, so when two controller > views need the same helper method, I move it into the > application_helper.rb file. As the project is growing, the > application_helper.rb file is becoming a bit clunky with methods that > apply to more than one controller's view, but that are certainly not > application-wide. Any ideas of good organization to keep helper > methods that span only a few controller's views tidy? > > Thanks, > > Andrew
Just put the common code into its own helper and put the: include MyCommonHelper into both (all) the controllers that need it. Name it something that describes the feature that it helps (and the ...Helper suffix will clue you into where to find it). -Rob Rob Biedenharn http://agileconsultingllc.com [email protected] --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

