Sorry for the slightly noobish question, as I am writing my first rails app.
I get the idea of the layout view, but if you are using them, is there any way to include a view specific js or css file? For example, I have layouts/products.html.erb
, and for products/edit.html.erb
I want products_edit.css
, but I don't want that css for all product views, what is the best practice to accomplish that?
Best Solution
If you have a generic edit.css file, I would suggest an if in your layout
Otherwise you can use
content_for
with ayield
to add additional tags into the head.layout.html.erb
products/edit.html.erb