Clint
Clint

Reputation: 201

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.

Upvotes: 0

Views: 50

Answers (1)

Sharvy Ahmed
Sharvy Ahmed

Reputation: 7405

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

Upvotes: 1

Related Questions