Skip to content

Instantly share code, notes, and snippets.

@augustl
Created September 22, 2008 08:37
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 augustl/11963 to your computer and use it in GitHub Desktop.
Save augustl/11963 to your computer and use it in GitHub Desktop.
<html>
<head>
<%= javascript_include_tag *javascripts %>
</head>
<body>
<%= yield %>
</body>
</html>
module ApplicationHelper
def javascripts(*scripts)
@javascripts ||= []
@javascripts.push(scripts).flatten!.uniq!
end
end
<% javascripts "foo", "bar" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment