aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-09-02 19:17:23 +1200
committerPhilip Arndt <parndt@gmail.com>2010-09-02 19:17:23 +1200
commit1a9f98217e11c8e3a8b7189f26f45890580160d2 (patch)
tree3c0f359c791e08043ee8dcff0f7c9b23406aaba6 /app
parent0c03044fca70cbbf9bb0be3cc0d957f6591121ea (diff)
downloadrefinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.tar.gz
refinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.tar.bz2
refinerycms-blog-1a9f98217e11c8e3a8b7189f26f45890580160d2.zip
Redirect properly after saving notification recipients and display a nice friendly message to the user.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/blog/settings_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb
index 52a7e83..541fa36 100644
--- a/app/controllers/admin/blog/settings_controller.rb
+++ b/app/controllers/admin/blog/settings_controller.rb
@@ -4,7 +4,14 @@ class Admin::Blog::SettingsController < Admin::BaseController
@recipients = BlogComment::Notification.recipients
if request.post?
- BlogComment::Notification.recipients == params[:recipients]
+ BlogComment::Notification.recipients = params[:recipients]
+ flash[:notice] = t('admin.blog.settings.notification_recipients.updated',
+ :recipients => BlogComment::Notification.recipients)
+ unless request.xhr? or from_dialog?
+ redirect_back_or_default(admin_blog_posts_path)
+ else
+ render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>"
+ end
end
end