diff options
author | Philip Arndt <parndt@gmail.com> | 2010-09-02 19:17:23 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-09-02 19:17:23 +1200 |
commit | 1a9f98217e11c8e3a8b7189f26f45890580160d2 (patch) | |
tree | 3c0f359c791e08043ee8dcff0f7c9b23406aaba6 /app/controllers/admin | |
parent | 0c03044fca70cbbf9bb0be3cc0d957f6591121ea (diff) | |
download | refinerycms-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/controllers/admin')
-rw-r--r-- | app/controllers/admin/blog/settings_controller.rb | 9 |
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 |