# Newbe question link\_to\_unless\_current

**URL:** <https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297>\
**Category:** Rails\
**Created:** [April 4, 2010, 12:51am UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297 "2010-04-04T00:51:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 12:51am UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/1 "2010-04-04T00:51:38Z")

</div>

Rails newbe here:

Using link\_to\_unless\_current and on my website it displays the the menu  
item and its entire path in () …

example:  
home (/)  
about (/welcome/about)  
register (/users/register) … and so on.

In my application\_helper:

# Methods added to this helper will be available to all templates in the

application.  
module ApplicationHelper

end

def nav\_link(text, controller, action = “index”)  
link\_to\_unless\_current text , {:controller =\> controller, :action =\>  
action}  
end

in my views/layout/application.html.erb

  
  

| \<%= nav\_link “Home”, “welcome” %\> |
| \<%= nav\_link “About”, “welcome”, “about” %\> |
| \<%= nav\_link "Profile", "welcome", "profile" %\> |
| \<%= nav\_link "Contact", "welcome", "contact" %\> |

routes file has:

# You can have the root of your site routed with map.root – just

remember to delete public/index.html.  
map.root :controller =\> “welcome” … standard stuff … right?

so why the path in in the link?

any help would be great. thanks

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 1:39am UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/2 "2010-04-04T01:39:33Z")

</div>

On Sat, Apr 3, 2010 at 3:51 PM, Don K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> action}  
> \<%= nav\_link “Contact”, “welcome”, “contact” %\>  
> any help would be great. thanks

Hi, couldn’t use the helper, link\_to\_unless\_current, directly within the  
application layout?

-Conrad

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 10:08am UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/3 "2010-04-04T10:08:11Z")

</div>

On 3 April 2010 23:51, Don K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Rails newbe here:
> 
> Using link\_to\_unless\_current and on my website it displays the the menu  
> item and its entire path in () …
> 
> example:  
> home (/)  
> about (/welcome/about)  
> register (/users/register) … and so on.

Are you sure you have not got some sort of debug or plugin enabled  
that is adding this? I seem to remember a similar issue a little time  
ago that turned out to be such an issue.

Colin

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/4 "2010-04-04T21:39:15Z")

</div>

On Sun, Apr 4, 2010 at 12:22 PM, Don K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > register (/users/register) … and so on.  
> > > 6.8

Can you tried things without an IDE?

-Conrad

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 9:22pm UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/5 "2010-04-04T21:22:11Z")

</div>

Colin L. wrote:

> On 3 April 2010 23:51, Don K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Rails newbe here:
> > 
> > Using link\_to\_unless\_current and on my website it displays the the menu  
> > item and its entire path in () …
> > 
> > example:  
> > home (/)  
> > about (/welcome/about)  
> > register (/users/register) … and so on.
> 
> Are you sure you have not got some sort of debug or plugin enabled  
> that is adding this? I seem to remember a similar issue a little time  
> ago that turned out to be such an issue.

Colin

I’ve tried running in production mode …also with different browsers to  
insure I wasn’t running some sort of debug mode Ive also looked through  
the IDE to see if there is some type of settings … Im using netbeans  
6.8

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 10:14pm UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/6 "2010-04-04T22:14:07Z")

</div>

> Can you tried things without an IDE?

one of the first things I tried

I’m using the bluebprint css plugin which I’ve used before without  
issue. I’ve looked through the css’s and actually don’t find any  
reference to the \<a href …\> tag.

---

<div class="post-metadata">

**Author:** ![dkowalski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://www.ruby-forum.com/u/dkowalski)\
**Post date:** [April 4, 2010, 10:25pm UTC](https://www.ruby-forum.com/t/newbe-question-link-to-unless-current/186297/7 "2010-04-04T22:25:20Z")

</div>

Don K. wrote:

> > Can you tried things without an IDE?
> 
> one of the first things I tried
> 
> I’m using the bluebprint css plugin which I’ve used before without  
> issue. I’ve looked through the css’s and actually don’t find any  
> reference to the \<a href …\> tag.

I spoke to soon …

blueprint css has three style sheets printing, screen and windows  
explorer (because MS is special or something…) anyway…

in the print css I found:

* * *

a:link:after, a:visited:after {content:" (" attr(href)  
“)”;font-size:90%;}

* * *

I commented out the print css and Im golden now.

Thanks for your help.
