Sha256: 72b07ea70398b83acfd590d4a08acd28e48cc69a20ea88dec4a6b845458491a1
Contents?: true
Size: 986 Bytes
Versions: 34
Compression:
Stored size: 986 Bytes
Contents
class InvitationsController < ApplicationController before_filter :authorize_admin, :except => [:show, :update] skip_before_filter :authenticate, :only => [:show, :update] layout Saucy::Layouts.to_proc def new assign_projects @invitation = Invitation.new render end def create @invitation = Invitation.new(params[:invitation]) @invitation.account = current_account if @invitation.save flash[:success] = "User invited." redirect_to account_memberships_url(current_account) else assign_projects render :action => 'new' end end def show @invitation = Invitation.find(params[:id]) render end def update @invitation = Invitation.find(params[:id]) if @invitation.accept(params[:invitation]) sign_in @invitation.user redirect_to root_url else render :action => 'show' end end private def assign_projects @projects = current_account.projects_by_name end end
Version data entries
34 entries across 34 versions & 1 rubygems