Class: ContactsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ContactsController
- Defined in:
- app/controllers/contacts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/contacts_controller.rb', line 6 def create @contact = Contact.new(contact_params) if @contact.save redirect_to new_contact_path, flash: { success: I18n.t('created') } else render 'new' end end |
#new ⇒ Object
2 3 4 |
# File 'app/controllers/contacts_controller.rb', line 2 def new @contact = Contact.new end |