Class: InvitationsController

Inherits:
BaseController show all
Defined in:
app/controllers/invitations_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#advertise, #cache_action?, #css_help, #footer_content, #homepage_features, #plaxo, #rss_site_index, #site_index

Methods included from LocalizedApplication

#get_matching_ui_locale, #get_sorted_langs_from_accept_header, #get_valid_lang_from_accept_header, #set_locale

Methods included from AuthenticatedSystem

#login_by_token, #update_last_seen_at

Instance Method Details

#createObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/invitations_controller.rb', line 24

def create
  @user = current_user

  @invitation = Invitation.new(params[:invitation])
  @invitation.user = @user
  
  respond_to do |format|
    if @invitation.save
      flash[:notice] = :invitation_was_successfully_created.l
      format.html { 
        unless params[:welcome]
          redirect_to user_path(@invitation.user) 
        else
          redirect_to welcome_complete_user_path(@invitation.user)            
        end
      }
    else
      format.html { render :action => "new" }
    end
  end
end

#editObject



19
20
21
# File 'app/controllers/invitations_controller.rb', line 19

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

#indexObject



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

def index
  @user = current_user
  @invitations = @user.invitations

  respond_to do |format|
    format.html 
  end
end

#newObject



13
14
15
16
# File 'app/controllers/invitations_controller.rb', line 13

def new
  @user = current_user
  @invitation = Invitation.new
end