Example:
I have 2 partial _map.haml and _bigmap.haml.
:: _map.haml
- content_for :map do
%script{:type => "text/javascript", :src => "http://maps.google.com/maps/api/js?sensor=true"}
...
:: _bigmap.haml
- content_for :bigmap do
%script{:type => "text/javascript", :src => "http://maps.google.com/maps/api/js?sensor=true"}
...
In my layout I include javascripts into
= yield(:map)
= yield(:bigmap)
QUESTION 1: This means google library will be included twice. How can I handle this so the library is always loaded only once? A was thinking of view heler maybe?
QUESTION 2: Is it possible to have a global content_for field where each partial appends it's content to it? Thx.