Created
March 19, 2010 12:01
-
-
Save elisehuard/337452 to your computer and use it in GitHub Desktop.
This file contains 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
# helpers for local :javascripts and :stylesheets | |
# add | |
# yield :javascripts | |
# yield :stylesheets | |
# in your header | |
def load_javascripts(*scripts) | |
load_content(:javascripts,*scripts) do |script| | |
javascript_include_tag script | |
end | |
end | |
def load_stylesheets(*args) | |
load_content(:stylesheets,*args) do |css| | |
stylesheet_link_tag css | |
end | |
end | |
def load_content(name,*args) | |
content_for name do | |
args.map do |arg| | |
yield(arg) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment