Skip to content

Instantly share code, notes, and snippets.

@iturgeon
Last active August 29, 2015 14:08
Show Gist options
  • Save iturgeon/56ba2af2fb255cb8cbd5 to your computer and use it in GitHub Desktop.
Save iturgeon/56ba2af2fb255cb8cbd5 to your computer and use it in GitHub Desktop.
playing with blocks
def js(*files)
content_for(:js) { javascript_include_tag(*files.map { |file| "/assets/js/#{file}"}) }
content_for(:js) do
javascript_include_tag(*files.map { |file| "/assets/js/#{file}"})
end
content_for(:js) do
derp = Proc.new { |file| "/assets/js/#{file}"}
javascript_include_tag *files.map(&derp)
end
content_for(:js) do
derp = proc { |file| "/assets/js/#{file}"}
javascript_include_tag *files.map(&derp)
end
content_for(:js) do
derp = lambda { |file| "/assets/js/#{file}"}
javascript_include_tag *files.map(&derp)
end
content_for(:js) do
files.map! { |file| "/assets/js/#{file}"}
javascript_include_tag *files
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment