Class: InvitationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- InvitationsController
- Defined in:
- app/controllers/invitations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/invitations_controller.rb', line 13 def create @invitation = Invitation.new(params[:invitation]) @invitation.account = current_account @invitation.sender = current_user if @invitation.save flash[:success] = "User invited." redirect_to account_memberships_url(current_account) else assign_projects render :action => 'new' end end |
#new ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/invitations_controller.rb', line 7 def new assign_projects @invitation = Invitation.new render end |
#show ⇒ Object
26 27 28 |
# File 'app/controllers/invitations_controller.rb', line 26 def show with_invitation { render } end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/invitations_controller.rb', line 30 def update with_invitation do if @invitation.accept(params[:invitation]) sign_in @invitation.user redirect_to root_url else render :action => 'show' end end end |