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.
9fa40e577cf1512431a82d55302b5d2f?d=identicon&s=25 Brent Collier (brentmc79)
on 2009-04-12 16: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?
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-12 16:59
(Received via mailing list)
Brent Collier 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...
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-12 17:00
(Received via mailing list)
Brent Collier 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...
9fa40e577cf1512431a82d55302b5d2f?d=identicon&s=25 Brent Collier (brentmc79)
on 2009-04-12 17:15
I've submitted the problem to the jRails people here:
http://code.google.com/p/ennerchi/issues/detail?id=41
9fa40e577cf1512431a82d55302b5d2f?d=identicon&s=25 Brent Collier (brentmc79)
on 2009-04-13 17: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.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-13 17:13
(Received via mailing list)
Brent Collier 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.