[Rails] Re: css url paths when moving it to a different folder
Robert Walker wrote in post #1101143:
> I find that the easiest way to figure out these relative paths is to
> look at the paths generated in the HTML in the browser. Once you know
> the exact path to your assets as seen by the browser it should be pretty
> easy to deduce the relative path from one asset to another.
Sorry, disregard my last reply!
This is the proper way:
.class { background-image: url(<%= asset_path 'image.png' %>) }
Taken from:
http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home