Forum: Ruby on Rails Helpers?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Buntin, Seth - KATE (Guest)
on 2006-02-17 21:04
(Received via mailing list)
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 B.
Kevin O. (Guest)
on 2006-02-17 21:53
(Received via mailing list)
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.

This topic is locked and can not be replied to.