Skip to content

Instantly share code, notes, and snippets.

@iHiD
Created June 25, 2012 19:47
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 iHiD/2990816 to your computer and use it in GitHub Desktop.
Save iHiD/2990816 to your computer and use it in GitHub Desktop.
Security Article Part 3 - 13
module DataHelper
def data_to_table(data)
content_tag :table do
rows = data.map do |row|
content_tag :tr do
cells = row.map do |cell|
content_tag :td, cell
end
safe_join(cells)
end
end
safe_join(rows)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment