views:

14

answers:

1

hi all

I'm using rails rjs, but I found it doesn't work, when I added "jquery.js" like this

<%= javascript_include_tag :defaults,'jquery.validate.min.js'%>

but when I changed it like this

<%= javascript_include_tag :defaults%>

It works, so weird! any helps? Thanks

A: 

Standard rjs works with prototype javascript library which ships with rails by default. When you added javascript_include_tag :defaults, you included this library (look at result html).

You can use remote javascript with JQuery. View this screencast how to do it. The best practice for now is to use unobtrusive javascript. Another screencast on this subject here. And it works not only with rails 3 but with rails 2.3 as well.

Voldy
ok, as you said, I using jquery now
juliet