Forum: Ruby on Rails Relative stylesheet reference

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sri Sankaran (Guest)
on 2006-03-07 20:21
(Received via mailing list)
Problem: The HREF generated by the stylesheet_link_tag is an absolute
path.

Details:
The layout for my view has the following line

  <%= stylesheet_link_tag 'scaffold' %>

At runtime, this gets translated to

<link href="/stylesheets/scaffold.css" ... />

This does not get resolved correctly.  The problem is the leading slash.
It should be

<link href="stylesheets/scaffold.css" .../>

How can I coerce this change?

Sri
Ben M. (Guest)
on 2006-03-08 06:00
(Received via mailing list)
Sri Sankaran wrote:
> This does not get resolved correctly.  The problem is the leading
> slash.  It should be

Why? Isn't your stylesheets folder under public? That's your webroot, so
/stylesheets/...
should look in that folder...


> <link href="stylesheets/scaffold.css" .../>
>
> How can I coerce this change?

maybe <%= stylesheet_link_tag 'stylesheet/scaffold' %>  ???
This topic is locked and can not be replied to.