How do I add multiple attachments to Mailboxer?
I am using the Mailboxer gem. I have enabled multiple file uploads for the attachment field. What is the best way to set up my controller so it saves all the attachments? Would making a new model called "message_attachment" be a good idea? In that case, how do I set up the message model (which I currently don't have in my model folder) so I can include "has_many message_attachments"?
= form_for @message, url: conversation_messages_path(@conversation) do |f|
= f.text_area :body, class: "form-control"
-# = f.file_field :attachment
= f.file_field :attachment, multiple: :true, name: "message_attachments[photo]"
= f.submit "Send", class: "submit"
receipt = current_user.reply_to_conversation(@conversation, params[:mailboxer_message][:body], nil, true, true, params[:mailboxer_message][:attachment])
Thank you very much!