[NUBY] Rails css files?

S

steven_todd_harris

I was trying to add a css file to my view in rails and I had some
trouble
figuring out where I should put the file. Should it be somewhere under
public?
Doesn't seem to work if it's under the view directory structure with
the .rhtml file.
 
S

Sascha Ebach

I was trying to add a css file to my view in rails and I had some
trouble figuring out where I should put the file. Should it be somewhere under
public?

Yes. Everything accessible by the web browser should be in the public
dir. If you make a public/css dir and put a file called layout.css in it
you could do

<link rel="stylesheet" type="text/css" media="screen"
href="/css/layout.css" />
 
J

jblomberg

There is a folder for this purpose located at
your_project_home/public/stylesheets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,901
Members
47,439
Latest member
elif2sghost

Latest Threads

Top