Forum: Ruby on Rails Problems with jRails and ajax helpers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brent C. (Guest)
on 2009-04-12 18:46
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:in `build_callbacks'
vendor/plugins/jrails/lib/jrails.rb:119:in `options_for_ajax'
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?
Phlip (Guest)
on 2009-04-12 18:59
(Received via mailing list)
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...
Phlip (Guest)
on 2009-04-12 19:00
(Received via mailing list)
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...
Brent C. (Guest)
on 2009-04-12 19:15
I've submitted the problem to the jRails people here:
http://code.google.com/p/ennerchi/issues/detail?id=41
Brent C. (Guest)
on 2009-04-13 19:04
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.
Phlip (Guest)
on 2009-04-13 19:13
(Received via mailing list)
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...
This topic is locked and can not be replied to.