fixes on the fly category creation

This commit is contained in:
Jens Ulferts
2013-07-15 18:16:59 +02:00
committed by Michael Frister
parent 8303552576
commit 4cc9aaf896
2 changed files with 14 additions and 4 deletions
@@ -33,10 +33,7 @@ class IssueCategoriesController < ApplicationController
redirect_to :controller => '/projects', :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]')
}
render :locals => { :project => @project, :category => @category }
end
end
else
+13
View File
@@ -0,0 +1,13 @@
<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2013 the OpenProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
See doc/COPYRIGHT.rdoc for more details.
++#%>
jQuery('#work_package_category_id').empty().append("<%= escape_javascript(options_from_collection_for_select(project.issue_categories, 'id', 'name', category.id)) %>");