Created
August 12, 2012 00:45
-
-
Save evanwalsh/3328255 to your computer and use it in GitHub Desktop.
Meta tag helper for Rails
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
# Accepts arguments like: | |
# meta_tag :warning, "HC SVNT DRACONES" | |
# or | |
# meta_tag charset: "utf-8" | |
def meta_tag *options | |
if (options.select {|o| o.is_a?(String) || o.is_a?(Symbol) }.count == options.count) && (options.count == 2) | |
tag :meta, name: options.first, content: options.last | |
else | |
tag :meta, *options | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment