Hello list, Originally, afaik, the modules in app/helpers are, by convention, only meant to be used as view helpers. With time, however, we ended up by only calling them helpers, which can cause some confusion and misconception, since helpers by itself are not attached to the view layer only. The other day I''ve seen a very interesting use of helper folder organization. Instead of putting a rb file in lib, plugins or whatever, my co-worker has created a sorthelper and has put it into app/helpers. Then, he included it in the controller with include, so, a controller helper. I know it''s not a big deal, but we have been so used to assign the files/modules in app/helpers to the view layer that it catched my attention and I though I would share -- maybe helpers/ could also be used for little "model helpers"?. Maybe I''m going too far here :) -- Of course, any insights appreciated :) Marcelo. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you have many of those (controller extensions) you can just create an "app/controller_helpers" folder, add it to the load path and be done with it. Once they grow big and bold enough you can move them to a simple plugin. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Tue, Apr 28, 2009 at 7:05 PM, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello list, > > Originally, afaik, the modules in app/helpers are, by convention, only meant > to be used as view helpers. With time, however, we ended up by only calling > them helpers, which can cause some confusion and misconception, since > helpers by itself are not attached to the view layer only. The other day > I''ve seen a very interesting use of helper folder organization. Instead of > putting a rb file in lib, plugins or whatever, my co-worker has created a > sorthelper and has put it into app/helpers. Then, he included it in the > controller with include, so, a controller helper. I know it''s not a big > deal, but we have been so used to assign the files/modules in app/helpers to > the view layer that it catched my attention and I though I would share -- > maybe helpers/ could also be used for little "model helpers"?. Maybe I''m > going too far here :) -- Of course, any insights appreciated :) > > Marcelo. > > > >
Thanks Maurício, good idea. 2009/4/28 Maurício Linhares <mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > If you have many of those (controller extensions) you can just create > an "app/controller_helpers" folder, add it to the load path and be > done with it. Once they grow big and bold enough you can move them to > a simple plugin. > > - > Maurício Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) > > > > On Tue, Apr 28, 2009 at 7:05 PM, Marcelo de Moraes Serpa > <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello list, > > > > Originally, afaik, the modules in app/helpers are, by convention, only > meant > > to be used as view helpers. With time, however, we ended up by only > calling > > them helpers, which can cause some confusion and misconception, since > > helpers by itself are not attached to the view layer only. The other day > > I''ve seen a very interesting use of helper folder organization. Instead > of > > putting a rb file in lib, plugins or whatever, my co-worker has created a > > sorthelper and has put it into app/helpers. Then, he included it in the > > controller with include, so, a controller helper. I know it''s not a big > > deal, but we have been so used to assign the files/modules in app/helpers > to > > the view layer that it catched my attention and I though I would share -- > > maybe helpers/ could also be used for little "model helpers"?. Maybe I''m > > going too far here :) -- Of course, any insights appreciated :) > > > > Marcelo. > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---