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
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/rsvp/session_controller.rb', line 12 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 if exceeded_access_attempts? redirect_when_locked else flash.alert = "Oops!! The code you entered is not valid. Please try again." redirect_to root_path end end end |
#destroy ⇒ Object
DELETE /session
28 29 30 31 |
# File 'app/controllers/rsvp/session_controller.rb', line 28 def destroy session[:invitation_id] = nil redirect_after_destroy end |
#index ⇒ Object
GET /session
9 |
# File 'app/controllers/rsvp/session_controller.rb', line 9 def index; end |