Forum: Ruby on Rails Iterating over a params hash

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8e7e5b934fcbcdfb475072685755457f?d=identicon&s=25 Taylor Strait (Guest)
on 2007-03-18 23:57
I need to iterate over a params hash to upload multiple pictures at
once.  My example only has one file for clarity.  Any help would be

Hash from form:
{"commit"=>"Add", "picture"=>{"1"=>{"title"=>"dsfsdf",

      params[:picture].each { |image|
                            new_image =
                            new_image.title = image[:title]
                            new_image.image = image[:image_data]

                           end }

TypeError in ImagesController#new
Symbol as array index
531eb73f8fbf05a197721d02b4e6aadb?d=identicon&s=25 Bogdan Ionescu (Guest)
on 2007-03-19 00:14
(Received via mailing list)
params[:picture].each_pair {|key,value|

value will be the has containing values for each individual picture
8e7e5b934fcbcdfb475072685755457f?d=identicon&s=25 Taylor Strait (Guest)
on 2007-03-19 01:44
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-05-05 10:54
(Received via mailing list)
Couldn't you just do:
params[:picture].each_value |image|
This topic is locked and can not be replied to.