Skip to content

Instantly share code, notes, and snippets.

@ChristianPeters
Created December 20, 2010 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChristianPeters/748382 to your computer and use it in GitHub Desktop.
Save ChristianPeters/748382 to your computer and use it in GitHub Desktop.
def javascript(print_tag = false, &block)
content_for(:javascript) do
if print_tag
js = Proc.new { block.call }
javascript_tag(&js)
else
capture(&block)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment