Class: Admin::Whatson::CommentsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::Whatson::CommentsController
- Defined in:
- app/controllers/admin/whatson/comments_controller.rb
Instance Method Summary collapse
Instance Method Details
#approved ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/admin/whatson/comments_controller.rb', line 14 def approved unless params[:id].present? @whatson_comments = WhatsonComment.approved render :action => 'index' else @whatson_comment = WhatsonComment.find(params[:id]) @whatson_comment.approve! flash[:notice] = t('approved', :scope => 'admin.whatson.comments', :author => @whatson_comment.name) redirect_to :action => params[:return_to] || 'index' end end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/admin/whatson/comments_controller.rb', line 9 def index @whatson_comments = WhatsonComment.unmoderated render :action => 'index' end |
#rejected ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/admin/whatson/comments_controller.rb', line 26 def rejected unless params[:id].present? @whatson_comments = WhatsonComment.rejected render :action => 'index' else @whatson_comment = WhatsonComment.find(params[:id]) @whatson_comment.reject! flash[:notice] = t('rejected', :scope => 'admin.whatson.comments', :author => @whatson_comment.name) redirect_to :action => params[:return_to] || 'index' end end |