Class: InvitationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/invitations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/invitations_controller.rb', line 12

def create
  @invitation = Invitation.new(params[:invitation])
  @invitation. = 
  if @invitation.save
    flash[:success] = "User invited."
    redirect_to ()
  else
    assign_projects
    render :action => 'new'
  end
end

#newObject



6
7
8
9
10
# File 'app/controllers/invitations_controller.rb', line 6

def new
  assign_projects
  @invitation = Invitation.new
  render
end

#showObject



24
25
26
27
# File 'app/controllers/invitations_controller.rb', line 24

def show
  @invitation = Invitation.find(params[:id])
  render
end

#updateObject



29
30
31
32
33
34
35
36
37
# File 'app/controllers/invitations_controller.rb', line 29

def update
  @invitation = Invitation.find(params[:id])
  if @invitation.accept(params[:invitation])
     @invitation.user
    redirect_to root_url
  else
    render :action => 'show'
  end
end