Sha256: a208e6b2bf8d7592846eeda58513435940e3dff51b5c7c148bc5a91c5636f608

Contents?: true

Size: 924 Bytes

Versions: 8

Compression:

Stored size: 924 Bytes

Contents

class InvitationsController < BaseController
  before_filter :login_required

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

    respond_to do |format|
      format.html 
    end
  end
  
  def new
    @user = current_user
    @invitation = Invitation.new
  end
  

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


  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
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
community_engine-2.3.2 app/controllers/invitations_controller.rb
community_engine-2.3.1 app/controllers/invitations_controller.rb
community_engine-2.3.0 app/controllers/invitations_controller.rb
community_engine-2.1.0 app/controllers/invitations_controller.rb
community_engine-2.0.0 app/controllers/invitations_controller.rb
community_engine-2.0.0.beta3 app/controllers/invitations_controller.rb
community_engine-2.0.0.beta2 app/controllers/invitations_controller.rb
community_engine-2.0.0.beta1 app/controllers/invitations_controller.rb