Link_to underlying urls/paths are showing in the actual view

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!

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

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?

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.

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.

On 29 June 2010 21:39, Matt R. [email protected] 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

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

<%= link_to “Here”, :url => {:controller => ‘home’, :action =>
‘inside_here’ }%>

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

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

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

On 12 August 2010 10:34, Jule N. [email protected] 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

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
The path is only visible on my rails page

thanks,

landge

On 12 August 2010 10:34, Jule N. [email protected] 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

Colin L. wrote:

On 12 August 2010 12:20, Jule N. [email protected] 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
Validation Results - W3C Markup Validator.
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

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 :wink:

/landge

On 12 August 2010 12:20, Jule N. [email protected] 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
The path is only visible on my rails page

The w3c html validator is not impressed with your html, see
Validation Results - W3C Markup Validator.
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

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.

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.

On 23 August 2010 15:58, Matt R. [email protected] 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

On 24 August 2010 18:02, Matt R. [email protected] 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