[Rails] Re: **NewBIE** CSS reference in view pages...

Alex Wayne
2006-07-31T17:59:06Z

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... 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">


My Site is Awesome!
  <%= stylesheet_link_tag ''style'' %>
  <%= javascript_include_tag :defaults %>


  <%= yield %>




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/.