BeachRunnerFred
BeachRunnerFred

Reputation: 18558

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!

Upvotes: 1

Views: 3758

Answers (2)

Gagan Gami
Gagan Gami

Reputation: 10251

Try this

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

Upvotes: 3

zetetic
zetetic

Reputation: 47548

Try stylesheet_link_tag as described in the Rails API Docs

Upvotes: 1

Related Questions