Created
April 24, 2009 10:34
-
-
Save gavinhughes/101053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add js functions to the page on document.ready. Arguments as strings. | |
# Ex: <% ready("hideDiv('div1');", "toggleFields();)") | |
# | |
def ready(*functions) | |
content = functions.each{ |fx| fx << ';' }.join(' ') | |
content_for(:head, javascript_tag("$(function() { #{content} });")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment