ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-rails
ruby-rails
[Rails] Re: CSS in Views
by Alan Francis other posts by this author
Feb 14 2006 5:47AM messages near this date
[Rails] Re: CSS in Views | Re: [Rails] Re: CSS in Views
Michael Boutros wrote:
>  Andrew Otwell wrote:
> >>How can I link to a CSS file in one of my view files?
> > 
> > Typically you do this in your layouts:
> > 
> > <%= stylesheet_link_tag "filename", :media => "all" %>
> > 
> > More here: http://rails.rubyonrails.com/classes/ActionView/Helpers/
> > AssetTagHelper.html#M000397
>  
>  I just tried this and in the source it is looking for 
>  /stylesheets/filename. In RadRails you cannot create folders, so I 
>  created the folder in explorer and moved the style.css file into that 
>  folder, but it still is not reading it. Also, I have changed filename to 
>  style.css. Thanks :)


If your css file is living in myrailsapp/public/stylesheets and is 
called mystylesheet.css, you would use <%= stylesheet_link_tag 
"mystylesheet", :media =>  "all" %>

The string you pass is the name of the file, minus the extension.  Since 
your file is called style.css, you should use <%= stylesheet_link_tag 
"style" %> .

Is this any clearer ?

A.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails mailing list
Rails@[...].org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thread:
Michael Boutros
Andrew Otwell
Michael Boutros
Alan Francis
Tony Collen
Mark Wilden
Ben Munat
Ken Kousen
Ben Munat
Michael Boutros

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved