On a somewhat-related note, how are you guys handling supplemental
Javascript libraries that you may want to include on a view, but not across
the application (or even layout for the controller)?  It's a similar concern
as the title.  As the view often best knows what the title of the page
should be, it also knows whether there are other Javascript libraries that
should be included.

I've put this in my layout:
<% (@extra_js_libs || []).each do |lib| -%>
     <%= javascript_include_tag lib %>
   <% end -%>

with this showing up in my view:
<% @extra_js_libs = ["comments", "voting"] %>

I'm not happy with it, but it works.  I'm wondering if it'd be nicer to
combine this in a way with our "t" helper, something like this within the
views:
<% for_layout :title, "abcdef"
     for_layout :javascript, ["script1", "script2"] %>

Just thinking out-loud here.. curious to see what others are doing.

On 2/23/07, Patrick Crowley <[EMAIL PROTECTED]> wrote:

Jibba jabba!

-- Patrick


On Feb 23, 2007, at 2:34 pm, Nathan Colgate Clark wrote:

> Slick! Murdock approves!

_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to