JDutil / contact_us

Gem providing simple Contact Form functionality with a Rails 3+ Engine.
http://contact-us-demo.herokuapp.com
MIT License
135 stars 57 forks source link

Making multiple contact forms #35

Closed mrudult closed 10 years ago

mrudult commented 10 years ago

How do I make multiple contact-us forms with the gem? Here, each of the form needs to send email to a different address. How can one achieve that?

JDutil commented 10 years ago

You would need to modify this gem to do that for you by making your own fork or creating some decorators to monkey patch whatever methods you want to override. This gem is not meant for that purpose, but I imagine you could simply either copy the contact model and/or mailer and modify them for each different address or situation your trying for. There are many ways to achieve what your doing, and it will come down to however you find works best for your applications requirements. At the least this gem should make for a good example of how to code each form manually although I'm sure you could create some sort of attribute or parameter to pass that changes who the email goes to for making things DRY.