diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin_public_body_category_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/admin_public_body_category_controller.rb b/app/controllers/admin_public_body_category_controller.rb index d138eb495..b0dde3219 100644 --- a/app/controllers/admin_public_body_category_controller.rb +++ b/app/controllers/admin_public_body_category_controller.rb @@ -82,6 +82,11 @@ class AdminPublicBodyCategoryController < AdminController I18n.with_locale(I18n.default_locale) do @category = PublicBodyCategory.new(params[:public_body_category]) if @category.save + if params[:headings] + params[:headings].values.each do |heading_id| + @category.add_to_heading(PublicBodyHeading.find(heading_id)) + end + end flash[:notice] = 'Category was successfully created.' redirect_to admin_category_index_url else |