I have discovered the good use of stylesheet_link_tag and
javascript_include_tag (I'm still learning) and it is very useful because I
have to use the relative_url_root way.
Now I wonder how I can use that for other URLs. I want a background image
for a table cell so I have to write something like:
(Of course the css is going to a separate file but the problem stays the
same.) What method should I use instead of url_for to do the correct url
mapping? link_to does not seem appropriate either.
Sorry for all the beginner questions!
(Of course the css is going to a separate file but the problem stays the
same.) What method should I use instead of url_for to do the correct url
mapping? link_to does not seem appropriate either.
If images/header.png is just a static file in your /public directory,
there's no need to use url_for. You only need to use url_for if you
want a dynamically-generated URL based on your routes in routes.rb. For
a static file, you can just put the URL in directly:
If images/header.png is just a static file in your /public directory,
there's no need to use url_for. You only need to use url_for if you
want a dynamically-generated URL based on your routes in routes.rb.
But I need a dynamic route here in order to have the relative_url_root url
rewriting applied... Can I use url_for then?
(Sorry if this is a strange question!)