Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2011 03:03
Show Gist options
  • Save anonymous/998399 to your computer and use it in GitHub Desktop.
Save anonymous/998399 to your computer and use it in GitHub Desktop.
def index
@carriers = Carrier.all.sort_by(&:name)
@lines = Array.new
@carriers.each do |c|
c.sw_profiles.each do |p|
@lines.push(c => p)
end
end
# which results in
[{Carrier id: ... name: ...} => {SWProfile id: ... name: ...}...]
# what I need is a new Array:
[{NewHash carrier_id: ... carrier_name: ... sw_profile_name: ... ...}, {} ...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment