Skip to content

Instantly share code, notes, and snippets.

@novohispano
Created October 30, 2013 16:15
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 novohispano/7235442 to your computer and use it in GitHub Desktop.
Save novohispano/7235442 to your computer and use it in GitHub Desktop.
Array of hashes
slugs = ["menu", "index", "food"]
contents = ["menu contents", "index contents", "food contents"]
pages = []
pages = slugs.each_with_index do |slug, index|
{slug: slug, content: contents[index]}
end
# [{slug: "menu", content: "menu contents"}, {slug: "index", content: "index contents"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment