app/controllers/likes_controller.rb
def destroy
        if like_once?
            @like.destroy
            redirect_to post_path(@post)
        end  
    end
#if the user has already liked the post, it can be destroyed (unliked)
if the user has already liked the post, it can be destroyed (unliked)
if the user has already liked the post it can be destroyed ( unliked )
def destroy
        if like_once?
            @like.destroy
            redirect_to post_path(@post)
        end  
    end
def destroy if like_once? @like . destroy redirect_to post_path ( @post ) end end
if the user has already liked the post, it can be destroyed (unliked)
if the user has already liked the post it can be destroyed ( unliked )