Class: Workarea::Admin::ContentBlogCommentsController

Inherits:
Admin::ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/content_blog_comments_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



25
26
27
28
29
# File 'app/controllers/workarea/admin/content_blog_comments_controller.rb', line 25

def destroy
  @blog_comment.destroy
  flash[:success] = t('workarea.admin.content_blogs_comments.flash_messages.destroyed')
  redirect_to content_blog_user_comments_path
end

#editObject



12
# File 'app/controllers/workarea/admin/content_blog_comments_controller.rb', line 12

def edit; end

#indexObject



7
8
9
10
# File 'app/controllers/workarea/admin/content_blog_comments_controller.rb', line 7

def index
  options = params.merge(built_sort: find_sort(Content::BlogComment))
  @blog_comments = Admin::BlogCommentsViewModel.new(nil, options)
end

#updateObject



14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/workarea/admin/content_blog_comments_controller.rb', line 14

def update
  if @blog_comment.update_attributes(blog_comment_params)
    flash[:success] = 'Blog entry comment has been updated'
    redirect_to content_blog_user_comments_path(
      content_blog_entry_id: params[:content_blog_entry_id]
    )
  else
    render :edit
  end
end