I am using the Mailboxer gem.
What is the best way to set up my controller so it saves all the attachments? (loop through it?)
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 please provide me a solution or a sample code
thanks.
I can show you path.
First off, you need to fork the repository and make changes in
Mailboxer::Messagemodel forhas_many :attachmentsaccepts_nested_attributes_for :attachmentsThen you can add
Mailboxer::Attachmentmodel and associate it withMailboxer::Messageusingbelogns_to :messageAfter that modify the relevant controller to permit attachments assuming your form is passing attributes following rails convention for nested attributes.