Class: Elabs::Member::CommentsController

Inherits:
MemberApplicationController show all
Defined in:
app/controllers/elabs/member/comments_controller.rb

Constant Summary

Constants inherited from MemberApplicationController

MemberApplicationController::DEFAULT_ORDER_FIELD, MemberApplicationController::MAX_ITEMS_PER_PAGE

Instance Method Summary collapse

Instance Method Details

#archiveObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/elabs/member/comments_controller.rb', line 6

def archive
  respond_to do |format|
    if @comment.archive!
      format.html { redirect_to @comment.content, notice: _('Comment was successfully archived.') }
      format.json { render json: @comment, status: :ok }
    else
      format.html { redirect_to @comment.content, notice: _('An error occurred during process') }
      format.json { render json: @comment.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject



18
19
20
21
22
23
24
25
# File 'app/controllers/elabs/member/comments_controller.rb', line 18

def destroy
  content = @comment.content
  @comment.destroy
  respond_to do |format|
    format.html { redirect_to content, notice: _('Comment was successfully destroyed.') }
    format.json { head :no_content }
  end
end