aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-11-18 13:54:15 +0000
committerGareth Rees <gareth@mysociety.org>2014-11-18 13:54:15 +0000
commitd5d0ec771afed58e91429cfa626a1ee96faa92fb (patch)
tree241597ee2ecb743764a4ceedfc90ee47c3780bdc /app
parent3a412f2ec2c8f8c0a0eb5000791165ab82e7a550 (diff)
parent401aef5cf0bad318ac753ee5fb547e23c22deeb4 (diff)
Merge branch '1977-update-categories-redirect-to-edit' into rails-3-develop
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_public_body_categories_controller.rb8
-rw-r--r--app/controllers/admin_public_body_headings_controller.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/admin_public_body_categories_controller.rb b/app/controllers/admin_public_body_categories_controller.rb
index fda09fa4a..5e305dde3 100644
--- a/app/controllers/admin_public_body_categories_controller.rb
+++ b/app/controllers/admin_public_body_categories_controller.rb
@@ -22,7 +22,8 @@ class AdminPublicBodyCategoriesController < AdminController
I18n.with_locale(I18n.default_locale) do
if params[:public_body_category][:category_tag] && PublicBody.find_by_tag(@category.category_tag).count > 0 && @category.category_tag != params[:public_body_category][:category_tag]
- flash[:notice] = 'There are authorities associated with this category, so the tag can\'t be renamed'
+ flash[:error] = "There are authorities associated with this category, so the tag can't be renamed"
+ render :action => 'edit'
else
if params[:headings]
heading_ids = params[:headings].values
@@ -48,10 +49,11 @@ class AdminPublicBodyCategoriesController < AdminController
if @category.update_attributes(params[:public_body_category])
flash[:notice] = 'Category was successfully updated.'
+ redirect_to edit_admin_category_path(@category)
+ else
+ render :action => 'edit'
end
end
-
- render :action => 'edit'
end
end
diff --git a/app/controllers/admin_public_body_headings_controller.rb b/app/controllers/admin_public_body_headings_controller.rb
index c7c80e802..84e5cbf35 100644
--- a/app/controllers/admin_public_body_headings_controller.rb
+++ b/app/controllers/admin_public_body_headings_controller.rb
@@ -10,8 +10,10 @@ class AdminPublicBodyHeadingsController < AdminController
@heading = PublicBodyHeading.find(params[:id])
if @heading.update_attributes(params[:public_body_heading])
flash[:notice] = 'Category heading was successfully updated.'
+ redirect_to edit_admin_heading_path(@heading)
+ else
+ render :action => 'edit'
end
- render :action => 'edit'
end
end