Strange behavior in app/assets/javascripts/application.js.rb
zw963 opened this issue · 0 comments
zw963 commented
Following is a example project. https://github.com/zw963/opal-on-rails-example
require 'rails-ujs'
# require 'turbolinks'
require 'opal'
require 'jquery'
require 'opal-jquery'
require 'console'
require_tree '.'
Document.ready? do
$console.log 'hello!'
end
When start this projet, we can see 'hello' is ouput in browser console 4 times.
But, if comment require_tree '.'
, it worked as expect. (only log 'hello' 1 time)
Thanks