Module: EaselHelpers::Helpers::JqueryHelper

Included in:
EaselHelpers::Helpers
Defined in:
lib/easel_helpers/helpers/jquery_helper.rb

Instance Method Summary collapse

Instance Method Details

#document_ready(&block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/easel_helpers/helpers/jquery_helper.rb', line 5

def document_ready(&block)
  html =  :script, :type => "text/javascript" do
    %(
      (function($) {
        $(document).ready(function() {
          #{capture(&block)}
        });
      })(jQuery);
    )
  end

  concat(html)
end