# Link\_to underlying urls/paths are showing in the actual view

**URL:** <https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690>\
**Category:** Rails\
**Created:** [March 24, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690 "2010-03-24T17:51:13Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [March 24, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/1 "2010-03-24T17:51:13Z")

</div>

for example I have the following simple code in my views:

\<%= link\_to “Here”, :controller =\> ‘home’, :action =\> ‘inside\_here’ %\>

I get the “actual” view in the page looking like this:

Here (/home/inside\_here)

where the underlying url is showing right beside the “Here” word. By  
default, the “Here” word should only be outputted and not the path  
underneath it.

Since we presently have no solution to this, my front-end guy keeps on  
enclosing these links with so as to hide the underlying links.  
It’s a big headache for him… he’s stressed.

Does anybody have any suggestion on what’s happening? Maybe there’s  
something wrong with the layout or with the stylesheets? Or  
javascript? Since the front-end guy was previously developing using  
Php and HTML that there might be some tiny detail that shouldn’t be  
used in Rails by convention. Although he knows the basics needed to  
output stuff (like link\_to, image\_tag, etc) in Rails… Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [March 24, 2010, 6:11pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/2 "2010-03-24T18:11:43Z")

</div>

> underneath it.  
> output stuff (like link\_to, image\_tag, etc) in Rails… Thanks a lot!  
> My guess is you have some javascript that is doing this. Rails  
> doesn’t do this by default.

Or, perhaps you have installed a plugin that overrides how link\_to  
works.

-philip

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [June 24, 2010, 6:04pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/3 "2010-06-24T18:04:20Z")

</div>

Adler Santos wrote:

> for example I have the following simple code in my views:
> 
> \<%= link\_to “Here”, :controller =\> ‘home’, :action =\> ‘inside\_here’ %\>
> 
> I get the “actual” view in the page looking like this:
> 
> Here (/home/inside\_here)
> 
> where the underlying url is showing right beside the “Here” word. By  
> default, the “Here” word should only be outputted and not the path  
> underneath it.

I’m getting the same thing. I’m on Rails 3.0.0.beta4.

Have you found a solution to this?

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [June 29, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/4 "2010-06-29T22:39:14Z")

</div>

Has anyone found a solution to this or is anyone else having this issue?

It’s odd to me that Adler and I would be the only ones. Especially since  
I am only using the defaults that Rails 3.0.0.beta4 provides.

I didn’t change the default JavaScript files. I have added them using  
:defaults. I don’t have any custom JavaScript running. I don’t have any  
added gems or plugins in my app yet.

Also, like I stated previously, this only happens when I use FireFox.  
Which is another oddity. Internet Explorer displays this correctly.

Any help on this issue would be greatly appreciated.

Thanks in advance,

–Matt R.

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [June 24, 2010, 7:00pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/5 "2010-06-24T19:00:39Z")

</div>

> I’m getting the same thing. I’m on Rails 3.0.0.beta4.
> 
> Have you found a solution to this?

One more thing. I only get this when I use Firefox (I haven’t tried  
Opera or Chrome though). In Interet Explorer, this works how it should  
with only showing the names and not the the paths in parenthesis.

I also took out the JavaScript in the app. I still recieve this in  
Firefox after removing JavaScript.

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [June 29, 2010, 10:46pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/6 "2010-06-29T22:46:56Z")

</div>

On 29 June 2010 21:39, Matt R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Which is another oddity. Internet Explorer displays this correctly.
> 
> Any help on this issue would be greatly appreciated.

I believe it is a FF add-on that does this, I have seen the question  
asked before, though don’t remember which one. Disable all your FF  
add-ons (Tools, Addons and disable them all) and see if it goes away.

Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [June 30, 2010, 12:51am UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/7 "2010-06-30T00:51:38Z")

</div>

Could you try wrapping the controller, action, etc. in a url hash

\<%= link\_to “Here”, :url =\> {:controller =\> ‘home’, :action =\>  
‘inside\_here’ }%\>

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 11, 2010, 12:14pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/8 "2010-08-11T12:14:19Z")

</div>

The path is showing up in my links too. Tried Safari and FireFox.  
Did you find a solution to this problem?

/landge

Matt R. wrote:

> Thanks for the tips Colin and Anand… Neither corrected the issue. I’m  
> going to see if I can do this from another system. I’m wondering if my  
> installation is jacked up or something. I’ll post again and let everyone  
> know what i’ve found. I’m on my system at work, so am limited by what I  
> can do. I’ll try this from home and see what I come up with.
> 
> Thanks again for the suggestions!
> 
> –Matt

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [July 1, 2010, 3:59pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/9 "2010-07-01T15:59:02Z")

</div>

Thanks for the tips Colin and Anand… Neither corrected the issue. I’m  
going to see if I can do this from another system. I’m wondering if my  
installation is jacked up or something. I’ll post again and let everyone  
know what i’ve found. I’m on my system at work, so am limited by what I  
can do. I’ll try this from home and see what I come up with.

Thanks again for the suggestions!

–Matt

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 11:34am UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/10 "2010-08-12T11:34:48Z")

</div>

Everything is fine with the IE 7!?  
What does this mean?

/landge

Jule N. wrote:

> The path is showing up in my links too. Tried Safari and FireFox.  
> Did you find a solution to this problem?
> 
> /landge
> 
> Matt R. wrote:
> 
> > Thanks for the tips Colin and Anand… Neither corrected the issue. I’m  
> > going to see if I can do this from another system. I’m wondering if my  
> > installation is jacked up or something. I’ll post again and let everyone  
> > know what i’ve found. I’m on my system at work, so am limited by what I  
> > can do. I’ll try this from home and see what I come up with.
> > 
> > Thanks again for the suggestions!
> > 
> > –Matt

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 12:42pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/11 "2010-08-12T12:42:04Z")

</div>

On 12 August 2010 10:34, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Everything is fine with the IE 7!?  
> What does this mean?

If you look at the html of the page (View, Page Source or similar in  
your browser) what do you see for the link tag? Post the link tag  
here if necessary.

Do you only see this on your rails app or is it on all pages?

Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 1:20pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/12 "2010-08-12T13:20:42Z")

</div>

Colin L. wrote:  
This is what I get (IE7):

Ukekalendar

```
    <a href="/nevrovakt/aktuelluke/1">1</a>

    <a href="/nevrovakt/aktuelluke/2">2</a>

    <a href="/nevrovakt/aktuelluke/3">3</a>

    <a href="/nevrovakt/aktuelluke/4">4</a>

```

etc. …

You can try it if you want on my testpage:  
[http://vaktliste.nevroradiologi.no](http://vaktliste.nevroradiologi.no)  
The path is only visible on my rails page

thanks,

landge

> On 12 August 2010 10:34, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Everything is fine with the IE 7!?  
> > What does this mean?
> 
> If you look at the html of the page (View, Page Source or similar in  
> your browser) what do you see for the link tag? Post the link tag  
> here if necessary.
> 
> Do you only see this on your rails app or is it on all pages?
> 
> Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 4:12pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/13 "2010-08-12T16:12:35Z")

</div>

Colin L. wrote:

> On 12 August 2010 12:20, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Colin L. wrote:
> 
> Could you make sure you get your quoting correct please and insert  
> your comments in the right place, I did not write the text below, you  
> did. Thanks.

Ok

> The w3c html validator is not impressed with your html, see  
> [http://validator.w3.org/check?uri=http%3A%2F%2Fvaktliste.nevroradiologi.no%2F&charset=(detect+automatically)&doctype=Inline&group=0](http://validator.w3.org/check?uri=http%3A%2F%2Fvaktliste.nevroradiologi.no%2F&charset=%28detect+automatically%29&doctype=Inline&group=0).  
> Whether this is the problem or not I do not know, but I would fix it  
> first.
> 
> If still not fixed then, since the additional text is not visible in  
> the html then I think either javascript or css must be doing it. I  
> would remove all the includes for scripts and css and see what  
> happens. Leave the code as it is, just remove the includes. But fix  
> the html first.

Thanks for your advice.  
I’ll try it later.

> Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 9:09pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/14 "2010-08-12T21:09:42Z")

</div>

Thanks for the tip Colin!

The visible path behind the links was generated by the css print layout.  
Everything works fine now!

Well, I still have to fix the html errors 😉

/landge

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 12, 2010, 2:43pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/15 "2010-08-12T14:43:14Z")

</div>

On 12 August 2010 12:20, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Colin L. wrote:

Could you make sure you get your quoting correct please and insert  
your comments in the right place, I did not write the text below, you  
did. Thanks.

> ```
> <a href="/nevrovakt/aktuelluke/3">3</a>
> 
> <a href="/nevrovakt/aktuelluke/4">4</a>
> 
> ```
> 
> etc. …
> 
> You can try it if you want on my testpage:  
> [http://vaktliste.nevroradiologi.no](http://vaktliste.nevroradiologi.no)  
> The path is only visible on my rails page

The w3c html validator is not impressed with your html, see  
[http://validator.w3.org/check?uri=http%3A%2F%2Fvaktliste.nevroradiologi.no%2F&charset=(detect+automatically)&doctype=Inline&group=0](http://validator.w3.org/check?uri=http%3A%2F%2Fvaktliste.nevroradiologi.no%2F&charset=%28detect+automatically%29&doctype=Inline&group=0).  
Whether this is the problem or not I do not know, but I would fix it  
first.

If still not fixed then, since the additional text is not visible in  
the html then I think either javascript or css must be doing it. I  
would remove all the includes for scripts and css and see what  
happens. Leave the code as it is, just remove the includes. But fix  
the html first.

Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 23, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/16 "2010-08-23T16:58:44Z")

</div>

Jule N. wrote:

> The visible path behind the links was generated by the css print layout.  
> Everything works fine now!

YES!!! Thanks everyone. This was driving me insane! I’m using the  
Blueprint CSS Framework. In the Print.css there is a line that reads:

* * *

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

* * *

Take out the following code:

* * *

content:" (" attr(href) “)”;

* * *

That will do it for you.

Thanks again everyone!

–Matt R.

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 24, 2010, 7:02pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/17 "2010-08-24T19:02:39Z")

</div>

Colin L. wrote:

> What I do not understand about this is why this was (apparently)  
> showing on screen when it was in print.css, which presumably is only  
> intended to be used for printing.

That was odd to me too. I guess I was just excited that my issue was  
solved, because I didn’t even think to check more into that. Think it’s  
something in Rails itself? Or the browsers. Maybe the way you use:  
stylesheet\_link\_tag :all

I’m not sure. Just grasping at straws. That’s how I import my css  
sheets.

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 23, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/18 "2010-08-23T17:05:52Z")

</div>

On 23 August 2010 15:58, Matt R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “)”;font-size:90%;}  
> What I do not understand about this is why this was (apparently)  
> showing on screen when it was in print.css, which presumably is only  
> intended to be used for printing.

Colin

---

<div class="post-metadata">

**Author:** ![Adler\_Santos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Post date:** [August 24, 2010, 10:12pm UTC](https://www.ruby-forum.com/t/link-to-underlying-urls-paths-are-showing-in-the-actual-view/185690/19 "2010-08-24T22:12:24Z")

</div>

On 24 August 2010 18:02, Matt R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Colin L. wrote:
> 
> > What I do not understand about this is why this was (apparently)  
> > showing on screen when it was in print.css, which presumably is only  
> > intended to be used for printing.
> 
> That was odd to me too. I guess I was just excited that my issue was  
> solved, because I didn’t even think to check more into that. Think it’s  
> something in Rails itself? Or the browsers. Maybe the way you use:  
> stylesheet\_link\_tag :all

That will load all the stylesheets in the stylesheets folder. If you  
have print and screen specific stylesheets you should load these  
individually specifying :media =\> “screen” and :media =\> “print” for  
the two relevant files so that one will be used on screen and the  
other for printing.

Colin
