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
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
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
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
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs