Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

styling css in RoR

when i try to style the homepage of a project i have no problem. when i try to link a different stylesheet to a different page on the website, it still carries the homepage style. i have confirmed i have correctly linked the pages together.

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

All your pages use the default applications.html.erb layout, which in turn carries all the css that you put into assets directory. You need to create different layout files and then render them for specific controllers or actions in those controllers. This link is quite old, but should work, at least it did for me:

http://stackoverflow.com/questions/8465411/how-to-assign-different-stylesheets-in-a-rails-project