简体   繁体   中英

Ruby on rails running javascript code

I have to use this in my rails project.

http://nv.github.com/objectDiff.js/

So I added the entire folder to the app/assets/javascript folder and added

//= require objectDiff in the application.js file.

But when I try to access the objectDiff.dif method, it says that there is no such method. I am new to rails. So please let me know if what I am doing is wrong.

Move objectDiff.js into assets/javascripts/
Move objectDiff.css into assets/stylesheets/

Then require the above files in their corresponding application files :

application.js :

//= require objectDiff

application.css :

*= require objectDiff

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM