Forum: Ruby on Rails Menu best practices

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
LeonB (Guest)
on 2007-05-31 00:55
(Received via mailing list)
Hi all,

What are your best practices with menu's in Ruby on Rails?

I have now created a helper that sees if a link is the same as the
current page an adds a class "active" to it.
The only problem is: a link to "users/new" doesn't work anymore when a
guest submits the form and the url becomes: "users/save".

How do you guys/girls deal with that?
Mark (Guest)
on 2007-05-31 01:00
You can use link_to_unless_current
(http://api.rubyonrails.org/classes/ActionView/Help...)
instead of writing your own custom helper that does the same thing.


LeonB wrote:
> Hi all,
>
> What are your best practices with menu's in Ruby on Rails?
>
> I have now created a helper that sees if a link is the same as the
> current page an adds a class "active" to it.
> The only problem is: a link to "users/new" doesn't work anymore when a
> guest submits the form and the url becomes: "users/save".
>
> How do you guys/girls deal with that?
LeonB (Guest)
on 2007-06-01 13:48
(Received via mailing list)
Ah, thanks Mark. Looks like a function I could use.

But is that all you use for menu's?
This topic is locked and can not be replied to.