Fix task validation #16
This commit is contained in:
parent
95efe554fc
commit
e561ddb064
2 changed files with 3 additions and 4 deletions
|
|
@ -17,14 +17,13 @@ class TasksController < ApplicationController
|
|||
|
||||
def create
|
||||
@task = Task.new(params[:task])
|
||||
if @task.errors.empty?
|
||||
@task.save
|
||||
if @task.save
|
||||
flash[:notice] = "Aufgabe wurde erstellt"
|
||||
if @task.workgroup
|
||||
redirect_to :action => "workgroup", :id => @task.workgroup
|
||||
else
|
||||
redirect_to :action => "index"
|
||||
end
|
||||
end
|
||||
else
|
||||
render :template => "tasks/new"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue