def destroy
      @category = LatoBlog::Category.find_by(id: params[:id])
      return unless check_category_presence

      if !@category.destroy
        flash[:danger] = @category.category_parent.errors.full_messages.to_sentence
        redirect_to lato_blog.edit_category_path(@category.id)
        return
      end
      
      flash[:success] = LANGUAGES[:lato_blog][:flashes][:category_destroy_success]
      redirect_to lato_blog.categories_path(status: 'deleted')
    end
def destroy
      @category = LatoBlog::Category.find_by(id: params[:id])
      return unless check_category_presence

      if !@category.destroy
        flash[:danger] = @category.category_parent.errors.full_messages.to_sentence
        redirect_to lato_blog.edit_category_path(@category.id)
        return
      end
      
      flash[:success] = LANGUAGES[:lato_blog][:flashes][:category_destroy_success]
      redirect_to lato_blog.categories_path(status: 'deleted')
    end
This function destroyes a category.