Can now join teams from the teams pages individually. If you already have a request active, it will remove that request and replace it with a new one (with a confirmation). I left the Agenda way of joining/cancelling join of teams.

This commit is contained in:
Room5-Joey 2014-05-13 16:54:51 -07:00 committed by Luke Barratt
parent 062d00c072
commit 9adf362f6b
6 changed files with 35 additions and 3 deletions

View file

@ -13,6 +13,16 @@ class TeamersController < ApplicationController
redirect_to_back
end
def edit
logger.info params
logger.info "hello world"
teamer_id = params["teamer"]
@teamer = Teamer.find(teamer_id)
@teamer.team_id = params["id"]
@teamer.save
redirect_to_back
end
def destroy
@teamer = Teamer.find params[:id]
raise AccessError unless @teamer.can_destroy? cuser

View file

@ -6,6 +6,8 @@ class TeamsController < ApplicationController
end
def show
@teamer = Teamer.new
@teamer.user = @user
end
def new
@ -13,6 +15,12 @@ class TeamsController < ApplicationController
raise AccessError unless @team.can_create? cuser
end
def replace_teamer
logger.info params
logger.info "hello"
redirect_to_back
end
def edit
raise AccessError unless @team.can_update? cuser
end

View file

@ -53,7 +53,7 @@ class UsersController < ApplicationController
if @user.valid? and @user.save
@user.profile = Profile.new
@user.profile.user = @user
@user.profile.save
@user.profile.save!
redirect_to action: :show, id: @user.id
save_session @user
else