Class: Watchtower::NotesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Watchtower::NotesController
- Defined in:
- app/controllers/watchtower/notes_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/watchtower/notes_controller.rb', line 5 def create @contact = Contact.find(params[:contact_id]) @note = @contact.notes.build(params[:note]) if @note.save redirect_to @contact, notice: "Note added." else redirect_to @contact, notice: "Note could not be added." end end |