Permalink
Browse files

Redirect properly after saving notification recipients and display a …

…nice friendly message to the user.
  • Loading branch information...
1 parent 0c03044 commit 1a9f98217e11c8e3a8b7189f26f45890580160d2 @parndt parndt committed Sep 2, 2010
Showing with 9 additions and 1 deletion.
  1. +8 −1 app/controllers/admin/blog/settings_controller.rb
  2. +1 −0 config/locales/en.yml
@@ -4,7 +4,14 @@ def notification_recipients
@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
View
@@ -49,6 +49,7 @@ en:
explanation: Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment.
hint: When a new comment is added, Refinery will send an email notification to you.
example: "Enter your email address(es) like: jack@work.com, jill@office.com"
+ updated: Notification recipients have been set to '{{recipients}}'
submenu:
categories:
title: Categories

0 comments on commit 1a9f982

Please sign in to comment.