I''m about to start work on sidebars for my app, but I''ve heard a number of people express doubts about them as the way to go (they are slow & apparently DHH regretted coming up with them components). What other solutions are people using for this type of need (i.e.needing to call an action/view combo from within a view)?
I use the very ugly method of putting alot code into the application helper and calling it on each page. On Tue, 2006-05-02 at 16:20 +0100, Chris T wrote:> I''m about to start work on sidebars for my app, but I''ve heard a number > of people express doubts about them as the way to go (they are slow & > apparently DHH regretted coming up with them components). What other > solutions are people using for this type of need (i.e.needing to call an > action/view combo from within a view)? > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060502/a03aee6a/attachment.html
Yeah, I can see that would work -- but also that it''s none too elegant. In the api docs it says: Don?t use components as a way of separating concerns inside a single application. Instead, reserve components to those rare cases where you truly have reusable view and controller elements that can be employed across many applications at once... Components <http://api.rubyonrails.org/classes/ActionController/Components.html> are a special-purpose approach that can often be replaced with better use of partials and filters. Does anyone have any examples of using partials and filters to replace components (or any other comments)? Charlie Bowman wrote:> I use the very ugly method of putting alot code into the application > helper and calling it on each page. > > On Tue, 2006-05-02 at 16:20 +0100, Chris T wrote: >> I''m about to start work on sidebars for my app, but I''ve heard a number >> of people express doubts about them as the way to go (they are slow & >> apparently DHH regretted coming up with them components). What other >> solutions are people using for this type of need (i.e.needing to call an >> action/view combo from within a view)? >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >
Perhaps "widgets" are the answer? link: http://blogrium.com/?p=60 Joe
Thanks. Will check them out. Am currently trying to sort something out with a before_filter, and it''s sort of working, but not wild about how I''m doing it. Joe wrote:> Perhaps "widgets" are the answer? link: http://blogrium.com/?p=60 > > Joe > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >