Hello, I want to implement ajax voting on the site using the acts_as_votable heme. There is such code:
def upvote @answer.upvote_from current_user, :vote_weight => 1 respond_to do |format| format.js end end In the views / answers folder I added the upvote.js.erb file and for a start I wrote a simple console.log there. But instead of displaying a message in the console, I get an error ActionController :: UnknownFormat. Please tell me how to fix? View code for response:
= link_to like_answer_path(answer), class: "like", 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= answer.get_upvotes.size = link_to unlike_answer_path(answer), class: "like", 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= answer.get_downvotes.size