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:
parent
f5f26a44c1
commit
97c5362cfe
|
@ -197,17 +197,26 @@ 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?
|
||||||
respond_to do |format|
|
if @category.save
|
||||||
format.html do
|
respond_to do |format|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
format.html do
|
||||||
redirect_to :action => 'settings', :tab => 'categories', :id => @project
|
flash[:notice] = l(:notice_successful_create)
|
||||||
|
redirect_to :action => 'settings', :tab => 'categories', :id => @project
|
||||||
|
end
|
||||||
|
format.js do
|
||||||
|
# IE doesn't support the replace_html rjs method for select box options
|
||||||
|
render(:update) {|page| page.replace "issue_category_id",
|
||||||
|
content_tag('select', '<option></option>' + options_from_collection_for_select(@project.issue_categories, 'id', 'name', @category.id), :id => 'issue_category_id', :name => 'issue[category_id]')
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
format.js do
|
else
|
||||||
# IE doesn't support the replace_html rjs method for select box options
|
respond_to do |format|
|
||||||
render(:update) {|page| page.replace "issue_category_id",
|
format.html
|
||||||
content_tag('select', '<option></option>' + options_from_collection_for_select(@project.issue_categories, 'id', 'name', @category.id), :id => 'issue_category_id', :name => 'issue[category_id]')
|
format.js do
|
||||||
}
|
render(:update) {|page| page.alert(@category.errors.full_messages.join('\n')) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue