On Wed, Mar 4, 2009 at 9:39 AM, MaD <[email protected]> wrote: > well, helpers are really meant for helping with displaying your data. > thats right. i actually didn't mean to write a helper-method, but a > method (in your controller) to help you with setting your records. my > fault (got lost in translating my thoughts). > i think your aproach of putting it into application-controller is a > good one (as long as you really need that method in more than one > controller).
One question I have for some time now is: What is the idiomatic place in the directory tree for positioning such "controller_helpers" ? ../app/helpers/ is really for view helpers. Of course, they could go in ../app/controllers/application.rb but then, that is inherited by _all_ controllers. We now put some "controller-helpers" in modules under /lib/ and then include those modules selectively in controllers. Or should we use sub classes for everything, but I read that is not the "Rails-way" either. Would it make sense to have default locations for "controller_helpers". Maybe something along the lines of: /app/view_helpers /app/controller_helpers /app/helpers --> /app/view_helpers The concept of helper :all (that we actually use now in ../app/controllers/application.rb) also seems broken as this is unclean mixing of view and controller helpers. How should I do this in a clean fashion ? Thanks, Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

