by sirn · 14y ago · 0 comments
# articles.css.scss
body#articles {
/* We display title in LARGE RED TEXT in articles controller. */
h2 {
font-size: 24px;
color: red;
}
&.index {
/* Oh noes we don't really want LARGE RED TEXT here. */
h2 { font-size: 16px; }
}
}
All my projects now started this way. It's very maintainable.In the footer of every page:
$(document).ready(function() {
if (V.Views.orders_index) { V.Views.orders_index(); }
}
Where "V.Views.orders_index" is basically "${controller}_${index}". Thus you just need to actually define that function in an included JS and voila, thats your calling hook and your JS is invoked.