I've asked a question recently on how to change 2 icons to text on click. The solution worked for a while, but now it's not working. Is there another way to do it or is the problem in the code? I face the problem with other scripts very often.
application.js
//= require jquery //= require jquery_ujs //= require bootstrap //= require jquery.ui.all //= require jquery.turbolinks //= require jquery_nested_form //= require_tree .
show.html.erb
true %> true %>
html output
icons.js
$('.thumbsdown a, .thumbsup a').on('click', function() { $('.thumbsdown').before('You voted') $('.thumbsdown, .thumbsup').remove() })