Created
March 21, 2012 18:54
-
-
Save nashby/2151258 to your computer and use it in GitHub Desktop.
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
attribute_names.map do |attribute_name| | |
attribute(attribute_name) | |
end.join.html_safe | |
# vs. | |
"".html_safe.tap do |attributes| | |
attribute_names.each do |attribute_name| | |
attributes.safe_concat attribute(attribute_name) | |
end | |
end | |
# vs | |
@template.safe_join(attribute_names.map do |attribute_name| | |
attribute(attribute_name) | |
end) | |
# vs | |
attribute_names.map do |attribute_name| | |
attribute(attribute_name) | |
end.inject(:safe_concat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment