Ruby on Rails 5 - CoffeeScript not working

0

I am struggling with the use of Javascript in Rails, specifically with CoffeeScript that does not load it into the application; in no internet tutorial I have seen clearly how to schedule events, I have only read that it is handled differently by turbolinks .

I have a test driver brands and I've already edited the brands.coffee file with the following code, but it does not work for me; supposedly with that you check when loading the page:

$(document).on "turbolinks:load", ->
  alert "page has loaded!"

Then I added a button to the view and looking for a code and adapted it like that, and it does not load me either:

$ ->
  $("#boton").on "click", ->
    alert "hiciste click"
    
asked by Leonardo Velazquez 28.05.2018 в 03:22
source

0 answers