From 1a9f98217e11c8e3a8b7189f26f45890580160d2 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Thu, 2 Sep 2010 19:17:23 +1200 Subject: Redirect properly after saving notification recipients and display a nice friendly message to the user. --- app/controllers/admin/blog/settings_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/controllers/admin/blog') 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 => "" + end end end -- cgit v1.2.3