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”.
You can use link_to_unless_current
(ActionView::Helpers::UrlHelper)
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”.