Ruby 1.9.2, Rails 3.1
Here is my understanding as to how layouts should be applied:
a. application. html.erb has the following helper method -
`<%= stylesheet_link_tag "application" %> `
and it basically says: "use application.css file and do whatever is mentioned there.
b. Application.css files has a directive to include all stylesheet files in the directory where it resides.
= `require_tree` .
(I have added the line above to the bottom of the application.css)
The problem is that the file products.css.scss is never applied to the page. When I go the the Developer Tools in chrome it shows that scaffolds.css is applied to the page. (Wanted to attach the pic but I can't as it is limited to new users)
I've been fighting with this thing for a while and can't figure it out. I need to find a way for application.css to do what it was supposed to do, to use the style definitions from the same directory and it is not happening.
UPDATE:
Here is the solution. in the index.htm.erb there was a block
<table class>
<% @products.each do |product| %>
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
I changed it to (see the first line)
<table class = "products">
<% @products.each do |product| %>
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
But the ting is - I have no idea why it started working, I have found this solution on the errata web page for the book that I'm reading, somebody just offered this as a solution. I'd appreciate if somebody can shed some light as to why this line helped.