Problems with jRails and ajax helpers

I working on a Rails 2.2.2 app that uses jRails and any time I attempt
to use a Rails ajax helper, I get the following error:

index 116545 out of string

with this stack trace:

vendor/plugins/jrails/lib/jrails.rb:197:in []=' vendor/plugins/jrails/lib/jrails.rb:197:inbuild_callbacks’
vendor/plugins/jrails/lib/jrails.rb:119:in options_for_ajax' vendor/plugins/jrails/lib/jrails.rb:51:inremote_function’

I verified that the no conflict snippet is included in the application
layout, and all libraries are up to date.

Does anyone have any idea what the problem might be?

Brent C. wrote:

vendor/plugins/jrails/lib/jrails.rb:51:in `remote_function’

I verified that the no conflict snippet is included in the application
layout, and all libraries are up to date.

Does anyone have any idea what the problem might be?

What’s on line 197? I don’t get a string with a []=, so I might have a
different
version. Whatever it is, you might debug and monkey-patch it, then
submit the patch.

The authors of jrails.rb deserve to have this question on their mailing
list or
home forum…

Brent C. wrote:

Does anyone have any idea what the problem might be?

Also, jrails does not ship with tests. I ought to remember to check them
before
adding a plugin…

I’ve submitted the problem to the jRails people here:
http://code.google.com/p/ennerchi/issues/detail?id=41

Brent C. wrote:

I figured it out. I was passing in a url as an argument as a string,
not as a hash with a :url key. So really, jRails isn’t broken, BUT it
should give me some sort of meaningful error, instead of just blowing
up, when passed invalid arguments.

Actually, helpers like remote_function should accept either a :url=>{}
with
parts or a string. That lets you use named routes…

I figured it out. I was passing in a url as an argument as a string,
not as a hash with a :url key. So really, jRails isn’t broken, BUT it
should give me some sort of meaningful error, instead of just blowing
up, when passed invalid arguments.