app/controllers/comments_controller.rb
# Comments cannot be edited after they've been replied to
Comments cannot be edited after they've been replied to
Comments cannot be edited after they ' ve been replied to
def check_permission_to_edit
    unless @comment && @comment.count_all_comments == 0
      flash[:error] = ts('Comments with replies cannot be edited')
      redirect_to(request.env["HTTP_REFERER"] || root_path) and return
    end
  end
def check_permission_to_edit unless @comment && @comment . count_all_comments == 0 flash [ :error ] = ts ( 'Comments with replies cannot be edited' ) redirect_to ( request . env [ "HTTP_REFERER" ] || root_path ) and return end end
Comments cannot be edited after they've been replied to
Comments cannot be edited after they ' ve been replied to