views:

122

answers:

1

I've got a formbuilder field specifically for doing DateTime using jQuery. What I'd like to do is have the helper able to push content out to my < head > through content_for. Any ideas?

Thanks, Stefan

+1  A: 

You can call any helper method on the @template instance variable. It holds the current template context.

class MyBuilder < ActionView::Helpers::FormBuilder

  def this_method_appends_content_for(content)
    @template.content_for(:head, content)
  end

end
Simone Carletti