How do you create javascript functions that are available project-wide in Ruby on Rails?

前端 未结 7 1529
攒了一身酷
攒了一身酷 2020-12-25 14:05

I put the following function in my application.js:

function test() {
  alert(\"See Me\")
}

classrooms/_new_small.html.haml:



        
相关标签:
7条回答
  • 2020-12-25 14:47

    Try using:

    <%= javascript_include_tag :all %>
    

    in your application.html.erb file

    0 讨论(0)
提交回复
热议问题