# Where to place css files

**URL:** <https://www.ruby-forum.com/t/where-to-place-css-files/179140>\
**Category:** Rails\
**Created:** [November 18, 2009, 11:49am UTC](https://www.ruby-forum.com/t/where-to-place-css-files/179140 "2009-11-18T11:49:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 18, 2009, 11:49am UTC](https://www.ruby-forum.com/t/where-to-place-css-files/179140/1 "2009-11-18T11:49:53Z")

</div>

Hi All,

I Have a .css file to effect those styles to my view where do i need to  
place in Rails directory stucture and how can i use the .css file name  
in my view  
My view file is in “app\views\home”.

Can any one please suggest me  
Thanx  
Chinna

---

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 18, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/where-to-place-css-files/179140/2 "2009-11-18T12:28:09Z")

</div>

Hi Chinna Gogulapati

```
You can place css files in public/stylesheets folder and can be 

```

linked to it by using stylesheet\_link\_tag helper in your layout file.  
As an example suppose a css file say example.css in public/stylesheets  
Now in app/views/layouts/application.html.erb(Or which ever layout you  
use) add this in section.

stylesheet\_link\_tag “example.css”

Sijo

---

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 18, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/where-to-place-css-files/179140/3 "2009-11-18T19:04:31Z")

</div>

Sijo k g wrote:

> Hi Chinna Gogulapati
> 
> ```
> You can place css files in public/stylesheets folder and can be 
> 
> ```
> 
> linked to it by using stylesheet\_link\_tag helper in your layout file.  
> As an example suppose a css file say example.css in public/stylesheets  
> Now in app/views/layouts/application.html.erb(Or which ever layout you  
> use) add this in section.
> 
> stylesheet\_link\_tag “example.css”

Right. I would also very strongly suggest _not_ using straight CSS.  
Sass and Compass can abstract your CSS into a much more maintainable  
form and completely do away with the need for presentation-based  
classes.

> Sijo

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
