开发者

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 p开发者_运维知识库ath 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!


Try this

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


Try stylesheet_link_tag as described in the Rails API Docs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜