Ali
Ali

Reputation: 7493

Creating a form to send multiple emails to existing emails using Rails

I'm building an order management system for customers. I need to set it up so I can build a form that emails a brief of the order status to a customer. The trick is that a customer can have multiple emails i.e no limits on that and the form I need to set up would show the brief generated in a textbox(nothing hard there) as well as a list of checkboxes with the email addresses which to send to.

Clicking on/off the checkboxes determines which addresses would the brief be sent to. I have everything worked out except for one main thing i.e the form - I'm not sure how can I actually set this part up i.e I'm using simple_form here and I'm not sure which model would I be making the form against? Do I need to build another model here? I'm pretty stuck.

Upvotes: 0

Views: 124

Answers (1)

Bob
Bob

Reputation: 2121

May be you can create model like Email without database and use all ActiveRecord helper methods. These articles may be helpful.

http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/

http://railscasts.com/episodes/193-tableless-model?view=asciicast

Upvotes: 1

Related Questions