Class: ContactsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ContactsController
- Defined in:
- app/controllers/contacts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/contacts_controller.rb', line 7 def create @form = Contact.new(params[:contact]) if @form.valid? @form.deliver redirect_to contact_path, notice: t('contact.notice.success') else flash[:warn] = t('contact.notice.error') render 'show' end end |
#show ⇒ Object
3 4 5 |
# File 'app/controllers/contacts_controller.rb', line 3 def show @form = Contact.new end |