can someone explain this code to me?

params[:image]....the actual file is here correct?

If you look at the form, it's probably using a group of file fields
with a name of 'image[]'. Get params have no concept of arrays, so
this is basically posted like this:


Rails parses fields with names ending in [] into an array. So
params[:image] is an array of the images from the file field.

and is that the same as this?



etc... for multiple files?

It's an array... params[:image][0]

also, what is the purpose for images? cant one just call

Image.create(:uploaded_data => img) inside the block?

Yup. Alex was just showing an example using #each instead of
#collect. #collect will return an array of the created images. With
#each, you have to populate an images array manually.