# Menu best practices

**URL:** <https://www.ruby-forum.com/t/menu-best-practices/105545>\
**Category:** Rails\
**Created:** [May 30, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/menu-best-practices/105545 "2007-05-30T22:55:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [May 30, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/menu-best-practices/105545/1 "2007-05-30T22:55:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [May 30, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/menu-best-practices/105545/2 "2007-05-30T23:00:52Z")

</div>

You can use link\_to\_unless\_current  
([ActionView::Helpers::UrlHelper](http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M000489))  
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?

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [June 1, 2007, 11:48am UTC](https://www.ruby-forum.com/t/menu-best-practices/105545/3 "2007-06-01T11:48:38Z")

</div>

Ah, thanks Mark. Looks like a function I could use.

But is that all you use for menu’s?
