2021 UPDATE: some parts of this tutorial are now out of date, please use Create a Contact Form in Rails 6 instead. The rails 5 / gmail version remains below for posterity.
This is a complete, step-by-step tutorial showing how to create a fully functional contact form in production in rails 5. Rather than reinvent things, the following borrows from the best available documentation and tutorials (most notably, this tutorial on making a contact form in development). The finished contact form can be viewed here.