Class: Rsvp::SessionController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Rsvp::SessionController
- Defined in:
- app/controllers/rsvp/session_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /session.
-
#destroy ⇒ Object
DELETE /session.
-
#index ⇒ Object
GET /session.
Instance Method Details
#create ⇒ Object
POST /session
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/rsvp/session_controller.rb', line 9 def create invitation = Invitation.find_by_rsvp_code(params[:rsvp_code]) if invitation session[:invitation_id] = invitation.id redirect_to (invitation.responses.any? ? show_response_index_path : response_index_path) else flash.alert = "Oops!! The code you entered is not valid. Please try again." redirect_to root_path end end |
#destroy ⇒ Object
DELETE /session
21 22 23 24 |
# File 'app/controllers/rsvp/session_controller.rb', line 21 def destroy session[:invitation_id] = nil redirect_to root_path, notice: "Thank you for your response!" end |
#index ⇒ Object
GET /session
6 |
# File 'app/controllers/rsvp/session_controller.rb', line 6 def index; end |