can someone explain this code to me?

images=params[:image].collect{|img|Image.create(:uploaded_data=>img}

i am confused at the block part. basically is this converting the hash into an array, going through each index in the array, and saving each photo into the Image table?   

Assuming Image is a plain old ActiveRecord class (no overwritten methods) then yes. The collect would iterate over every image saving the records (the records would contain just two fields with values: id and uploaded_data) and returning finally an array with the AR objects created.

regards

javier ramirez