Fixed: no error message when creating a category from the issue form fails (#1477).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3118 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-12-02 21:18:05 +00:00
parent f5f26a44c1
commit 97c5362cfe
1 changed files with 19 additions and 10 deletions

View File

@ -197,7 +197,8 @@ class ProjectsController < ApplicationController
# Add a new issue category to @project # Add a new issue category to @project
def add_issue_category def add_issue_category
@category = @project.issue_categories.build(params[:category]) @category = @project.issue_categories.build(params[:category])
if request.post? and @category.save if request.post?
if @category.save
respond_to do |format| respond_to do |format|
format.html do format.html do
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
@ -210,6 +211,14 @@ class ProjectsController < ApplicationController
} }
end end
end end
else
respond_to do |format|
format.html
format.js do
render(:update) {|page| page.alert(@category.errors.full_messages.join('\n')) }
end
end
end
end end
end end