You still have not really explained the problem. Start with just one
problem that you want to solve. Don't ask a general question,
describe exactly what you want to do and what the problem is.
Remember, start with just the first thing you are having a problem
with. Once that is sorted you can move on to the next problem.
Upload is fine.
Suppose I am uploading five images, which I can do with file upload.
But I also need to upload those images to a specific category. I also need to save Image name and which category(dropdown) it belongs into the db.
Suppose I uploaded 2 images:-
After clicking on submit, I will get :-
Image , Image Name : Text(We have to input), Category : Dropdown ---- It will repeat
Are you trying to assign these attributes after the file is uploaded, or at the same time that you upload it? I usually follow this pattern (pseudocode!!):
class Article < ActiveRecord::Base
has_many :images, :dependent => :destroy
accepts_nested_attributes_for :images
...
end
class Image < ActiveRecord::Base
belongs_to :article
...
end
Image can have all the unique attributes -- filename, uuid, whatever else is needed by your chosen attachment library (Dragonfly, Paperclip, CarrierWave) along with the category, caption, anything else you need in your application.
The upshot of this construction is that you can attach as many rich (decorated) children to the parent as you need, and each one will be fully populated in a single form submission. You won't need to come back and edit the children to add the metadata to the file later (although you can if you really want to).
Again, what’s your question? You seem to have posted a question, described what you want, then also how you would solve it - by saving all images and then editing their content. I really don’t see a topic for discussion here.