mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-31 00:41:20 +00:00
Purged git history and removed sensitive information.
This commit is contained in:
commit
6bcc8dc76b
862 changed files with 25312 additions and 0 deletions
23
app/controllers/teamers_controller.rb
Normal file
23
app/controllers/teamers_controller.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
class TeamersController < ApplicationController
|
||||
def create
|
||||
@teamer = Teamer.new params[:teamer]
|
||||
raise AccessError unless @teamer.can_create? cuser, params[:teamer]
|
||||
@teamer.user = cuser unless cuser.admin?
|
||||
|
||||
if @teamer.save
|
||||
flash[:notice] = t(:applying_team) + @teamer.team.to_s
|
||||
else
|
||||
flash[:error] = @teamer.errors.full_messages.to_s
|
||||
end
|
||||
|
||||
redirect_to_back
|
||||
end
|
||||
|
||||
def destroy
|
||||
@teamer = Teamer.find params[:id]
|
||||
raise AccessError unless @teamer.can_destroy? cuser
|
||||
|
||||
@teamer.destroy
|
||||
redirect_to_back
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue