chandrashekar
chandrashekar

Reputation: 619

Rails loads css files from public/stylesheet instead of app/assets in development mode

I am using Ruby on Rails 3.0.0 and I want to load CSS stylesheet file form public/stylesheet.

Upvotes: 1

Views: 457

Answers (1)

Mahammad Adil Azeem
Mahammad Adil Azeem

Reputation: 9392

For versions greater that 3.0.0 go to app/views/layouts/application.html.[erb/haml or whatever] and add the line

= stylesheet_link_tag 'application'

under your head tag. This way you can link your page to the stylesheet at app/assets/stylesheets/application.css. You can choose your desired file name instead of "application". But for versions upto 3.0.0(included) the above code will link the css file at public/stylesheets/application.css. Check this out

Upvotes: 1

Related Questions