Answer the question
In order to leave comments, you need to log in
How to rewrite Haml to erb?
I just recently started learning Rails.
I'm trying to implement the ability to like and dislike posts.
Getting error " undefined local variable or method `vote_text' "
in _reply_link.erb template
- vote_text = curent_user&.voted_for?(task) ? "Отменить отклик" : "Откликнуться"
<%= link_to vote_text, reply_task_path(task), method: :put, remote: :true %>
Answer the question
In order to leave comments, you need to log in
erb:
<% vote_text = curent_user&.voted_for?(task) ? "Отменить отклик" : "Откликнуться" %>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question