简体   繁体   中英

How do I link to an external stylesheet in Ruby on Rails?

I'm trying to link to the YUI reset stylesheet in my RoR layout using the following statement...

<%= stylesheet_path("http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css") %> 

but this path is being echoed on my page instead of being applied. I got this syntax from the the rails docs. What am I doing wrong?

Thanks!

尝试这个

<%= stylesheet_link_tag 'application','http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' %>

尝试使用Rails API文档中描述的stylesheet_link_tag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM