Skip to content

Instantly share code, notes, and snippets.

@beneggett
Created October 18, 2013 21:59
Show Gist options
  • Save beneggett/7048876 to your computer and use it in GitHub Desktop.
Save beneggett/7048876 to your computer and use it in GitHub Desktop.
Creating a Contact Form, Mailer

Creating a Contact Form & Mailer

Create a working contact form in your application that will allow a user to send you an email. At a minimum should have a sender email, subject, and body as part of the form. It should have validations that make sure that required fields are submitted & email address is properly formatted. The messages should not be ultimately stored in the database, you can choose how to implement that (Non-active record model vs destroying entries after create)/

Instructions

  • Create a message model
  • Create a contact us controller with new & create actions & associated views
  • Create a mailer & associated views (use layout if you have one)
  • Hook the mailer up to the create action in your contact us controller
  • Refactor your message model to not store the information in the database

** My non-active-record based model is here for reference: https://github.com/devpointlabs/devpoint-labs/blob/master/app/models/message.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment