remove before_filter from controllers
This commit is contained in:
parent
f87b76a805
commit
dcea52203d
4 changed files with 34 additions and 33 deletions
|
@ -21,11 +21,11 @@ class Teams::ProjectsController < Teams::ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@user_team = user_team
|
||||
team_project
|
||||
end
|
||||
|
||||
def update
|
||||
if user_team.update_project_access(project, params[:greatest_project_access])
|
||||
if user_team.update_project_access(team_project, params[:greatest_project_access])
|
||||
redirect_to admin_team_path(user_team), notice: 'Membership was successfully updated.'
|
||||
else
|
||||
render :edit
|
||||
|
@ -33,7 +33,14 @@ class Teams::ProjectsController < Teams::ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
user_team.resign_from_project(project)
|
||||
user_team.resign_from_project(team_project)
|
||||
redirect_to admin_team_path(user_team), notice: 'Project was successfully removed.'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def team_project
|
||||
@project ||= @team.projects.find_by_path(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue