Class: Admin::Blog::SettingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Admin::Blog::SettingsController
- Defined in:
- app/controllers/admin/blog/settings_controller.rb
Overview
@Name: Admin Blog Settings controller @Use: Creating , modifying, deleting blog settings for the cms @Created date: 08-06-2012 @Modified Date: 29-06-2012
@Company: Mindfire Solutions
Instance Method Summary collapse
-
#comments ⇒ Object
Checking for the blog is commentable or not then do commentable or uncommentable.
-
#moderation ⇒ Object
Checking for the blog is moderatable or not then do moderatable or moderatable.
-
#notification_recipients ⇒ Object
notification_recipients for notifying recipients.
Methods inherited from ApplicationController
Methods included from BlogHelper
#blog_archive_list, #blog_post_teaser, #next_or_previous?
Instance Method Details
#comments ⇒ Object
Checking for the blog is commentable or not then do commentable or uncommentable
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/admin/blog/settings_controller.rb', line 23 def comments value = BlogPost::CommentSetting.is_comments_allowed? if value BlogPost::CommentSetting.do_uncommentable else BlogPost::CommentSetting.do_commentable end redirect_to request.env['HTTP_REFERER'] end |
#moderation ⇒ Object
Checking for the blog is moderatable or not then do moderatable or moderatable
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/admin/blog/settings_controller.rb', line 36 def moderation value = BlogPost::CommentSetting.is_comments_moderated? if value BlogPost::CommentSetting.do_unmoderatable else BlogPost::CommentSetting.do_moderatable end redirect_to request.env['HTTP_REFERER'] end |
#notification_recipients ⇒ Object
notification_recipients for notifying recipients
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'app/controllers/admin/blog/settings_controller.rb', line 49 def notification_recipients @recipients = BlogComment::Notification.recipients if request.post? BlogComment::Notification.recipients = params[:recipients] flash[:notice] = t('admin.blog.settings.notification_recipients.updated', :recipients => params[:recipients]) unless request.xhr? redirect_to admin_blog_posts_path else render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>", :layout => false end end end |