Hello, there is such a condition:
- if user_signed_in? - if current_user.voted_for? answer and answer.liked_by current_user = link_to unlike_answer_path(answer), class: "unlike", remote: true, method: :put do button.btn.btn-info aria-label=("Left Align") type="button" span.glyphicon.glyphicon-thumbs-down.glyphicon-align-center aria-hidden="true" span.badge id="badge_downvote_value" = answer.get_downvotes.size - elsif current_user.voted_for? answer and answer.disliked_by current_user = link_to like_answer_path(answer), class: "like", remote: true, method: :put do button.btn.btn-info aria-label=("Left Align") type="button" span.glyphicon.glyphicon-thumbs-up.glyphicon-align-center aria-hidden="true" span.badge id="badge_upvote_value" = answer.get_upvotes.size
First, I check or enter the user, and then if he voted and likes the answer - I hide the like button and display the dislike button, otherwise, on the contrary, I hide the dislike button and display the button for like. BUT for reasons I do not understand, only the dislike button is constantly displayed. and it does not work. That is, when you try to put dislike, nothing happens. If you remove the conditions and leave just 2 buttons, then everything works fine.