I am trying to upload multiple images but after selecting multiple images refile creating only one record. I have checked out gorails refile video from there they shown upload through adding image_id to table. But here refile multiple file uploads
they are working with Image model.
Can anyone help me on this?
here is my code:
My model
class Photo < ActiveRecord::Base
acts_as_votable
attachment :image
has_many :users
has_many :images
end
My controller params
def photo_params
params.require(:photo).permit(:photo_title, :photo_description,:photo_caption,
:image, :image_cache_id, :remove_image,)
end
Photo form view
<%= f.attachment_field :image, direct: true, multiple: true %>