Mister Stylizedgeek
2006-Jul-31 16:19 UTC
[Rails] **NewBIE** CSS reference in view pages...
I''m a newbie...I have this CSS file created STYLES.CSS which i want to cll into every page under views...how can i do that...<link> tag doesn''t seem to be working here...any help is greatly appreciated...thanks! -- Posted via http://www.ruby-forum.com/.
Mister Stylizedgeek wrote:> I''m a newbie...I have this CSS file created STYLES.CSS which i want to > cll into every page under views...how can i do that...<link> tag doesn''t > seem to be working here...any help is greatly appreciated...thanks!You want to stick it in your layout. First of all create a file called /app/views/layouts/aplication.rhtml Stick some standard html file structure in there, as well as a <%= stylesheet_link _tag ''styles'' %> A super simple standard layout will look like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>My Site is Awesome!</title> <%= stylesheet_link_tag ''style'' %> <%= javascript_include_tag :defaults %> </head> <body> <%= yield %> </body> </html> Now all your views in rendered by your actions in various controller will be inserted into the <%= yield %> thus wrapping your templates with style sheets, titles, and other html goodness. -- Posted via http://www.ruby-forum.com/.
Alternatively, the gentleman may rename or append STYLES.CSS to public/scaffold.css. On 7/31/06, Alex Wayne <rubyonrails@beautifulpixel.com> wrote:> > I''m a newbie...I have this CSS file created STYLES.CSS which i want to > > cll into every page under views...how can i do that...<link> tag doesn''t > > seem to be working here...any help is greatly appreciated...thanks!-- Cheers, Hasan Diwan <hasan.diwan@gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060801/37c3968e/attachment.html