Would I use a helper for this situation? I have a layout that is used over two controllers (admin and login). Each controller has their own navigation. Can I do something like this? <%= getNavigation("admin") %> or <%= getNavigation("login") %> And return the navigation list depending on the string sent? Seth Buntin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/99df4197/attachment.html
You could do it the way you suggest or... 1. use a component to render the navigation, or 2. use a partial template personally I reserve helpers for methods that do some work, if it is all just ''view'' stuff (like links, etc), I would just put it in a partial. _Kevin On Friday, February 17, 2006, at 1:04 PM, Buntin, Seth - KATE wrote:>Would I use a helper for this situation? > > > >I have a layout that is used over two controllers (admin and login). >Each controller has their own navigation. Can I do something like this? > > > ><%= getNavigation("admin") %> or <%= getNavigation("login") %> > > > >And return the navigation list depending on the string sent? > > > >Seth Buntin > > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails >-- Posted with http://DevLists.com. Sign up and save your time!
After I sent the post I started thinking about what I should do and the partials popped into my head and I had a "Doh!" moment. Thanks. Seth -----Original Message----- From: Kevin Olbrich [mailto:devlists-rubyonrails@devlists.com] Sent: Friday, February 17, 2006 1:53 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Helpers? You could do it the way you suggest or... 1. use a component to render the navigation, or 2. use a partial template personally I reserve helpers for methods that do some work, if it is all just ''view'' stuff (like links, etc), I would just put it in a partial. _Kevin On Friday, February 17, 2006, at 1:04 PM, Buntin, Seth - KATE wrote:>Would I use a helper for this situation? > > > >I have a layout that is used over two controllers (admin and login). >Each controller has their own navigation. Can I do something likethis?> > > ><%= getNavigation("admin") %> or <%= getNavigation("login") %> > > > >And return the navigation list depending on the string sent? > > > >Seth Buntin > > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails >-- Posted with http://DevLists.com. Sign up and save your time!