Some fixes for tasks.
This commit is contained in:
parent
03d84aed1d
commit
2e56bfe895
12 changed files with 53 additions and 87 deletions
|
|
@ -17,14 +17,8 @@ class TasksController < ApplicationController
|
|||
|
||||
def create
|
||||
@task = Task.new(params[:task])
|
||||
if @task.errors.empty?
|
||||
@task.save
|
||||
flash[:notice] = "Aufgabe wurde erstellt"
|
||||
if @task.workgroup
|
||||
redirect_to :action => "workgroup", :id => @task.workgroup
|
||||
else
|
||||
redirect_to :action => "index"
|
||||
end
|
||||
if @task.save
|
||||
redirect_to tasks_url, :notice => "Aufgabe wurde erstellt"
|
||||
else
|
||||
render :template => "tasks/new"
|
||||
end
|
||||
|
|
@ -60,15 +54,6 @@ class TasksController < ApplicationController
|
|||
redirect_to :action => "index"
|
||||
end
|
||||
|
||||
# Delete an given Assignment
|
||||
# currently used in edit-view
|
||||
def drop_assignment
|
||||
ass = Assignment.find(params[:id])
|
||||
task = ass.task
|
||||
ass.destroy
|
||||
redirect_to :action => "show", :id => task
|
||||
end
|
||||
|
||||
# assign current_user to the task and set the assignment to "accepted"
|
||||
# if there is already an assignment, only accepted will be set to true
|
||||
def accept
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue