Rails and SCSS working together

elmercanary

New Member
If I go with this style of coding where for a scaffold of "Products" I add this to the applications.html.erb:\[code\]<body class = '<%= controller.controller_name %> ' >\[/code\]and then in the stylesheets of products.css.scc I define it nested like this for "products" :\[code\].products { table { border-collapse: collapse; } table tr td { padding: 5px; vertical-align: top; } .list_image { width: 60px; height: 70px; } .list_description { width: 60%; dl { margin: 0; } dt { color: #244; font-weight: bold; font-size: larger; } dd { margin: 0; } }// .... continued...\[/code\]and then in the products/index/index.html.erb for example I can have stuff like \[code\]<td class = "list_description" >\[/code\] , ...So my question is then do I need some sort of fully qualified naming to access the nested classes in that css file? or I can just name them without their hierarchy? I saw this way of doing CSS in DHH's agile book - well he created Rails! - but in Michael Hartl's book he is doing it a little more traditional was of CSS embedding . So which one is better?
 
Back
Top