Module: Viewaide::Helpers::JqueryHelper
- Included in:
- Viewaide::Helpers
- Defined in:
- lib/viewaide/helpers/jquery_helper.rb
Instance Method Summary collapse
-
#document_ready(&block) ⇒ String
generates a script tag with the appropriate type, an anonymous function (assigning jQuery to $), and within a #ready callback.
Instance Method Details
#document_ready(&block) ⇒ String
generates a script tag with the appropriate type, an anonymous function (assigning jQuery to $), and within a #ready callback
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/viewaide/helpers/jquery_helper.rb', line 26 def document_ready(&block) html = content_tag :script, :type => "text/javascript" do %( (function($) { $(document).ready(function() { #{capture(&block)} }); })(jQuery); ) end concat(html) end |