views:

30

answers:

2

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required files to those placeholders.

Currently I'm creating two strings in my master that I append to in my views.
This results in an ugly and error prone rendering.
Is there a better way to implement this?

A: 

Check if this answers you question: http://stackoverflow.com/questions/127267/does-nhaml-have-a-contentfor-ability-for-layouts

queen3
Not really. Placeholders aren't really what I'm looking for.The solution that is suggested there too (with the variable in the master) is what I'm already doing, but it kind of sucks.
borisCallens
+1  A: 

Is there a better way to implement this?

Yes. This is how I did it and so far it works great for me.

Dmytrii Nagirniak
Thx. I saw your post earlier. I don't feel comfortable with limiting the number of css and js files, but re-reading your solution gave me some hints I will investigate.
borisCallens