Forum: Ruby on Rails RJS call in :complete of form_remote_tag

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.
Db912f6efe445bc04c923c14c4be5a76?d=identicon&s=25 Max (Guest)
on 2007-06-17 23:39
(Received via mailing list)
Hi,

this should be easy:

I have a "test.rjs" and I want to call it from the :complete of a
form_remote_tag.

How would I do that?

Thanks,
Max
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2007-06-17 23:55
(Received via mailing list)
Hi Max,

Max wrote:

> I have a "test.rjs" and I want to call it from the :complete
> of a form_remote_tag.
>
> How would I do that?

I'm not sure you can.  I'm pretty sure that the callback options on
form_remote_tag are only useful for calling javascript that's already in
the
page that's loaded in the browser.

Bill
Db912f6efe445bc04c923c14c4be5a76?d=identicon&s=25 Max (Guest)
on 2007-06-18 00:37
(Received via mailing list)
> I'm not sure you can.  I'm pretty sure that the callback options on
> form_remote_tag are only useful for calling javascript that's already in the
> page that's loaded in the browser.

So where should I put the code instead?
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2007-06-18 02:28
(Received via mailing list)
Hi Max,

Max wrote:

>> I'm not sure you can.  I'm pretty sure that the callback
>> options on form_remote_tag are only useful for calling
>> javascript that's already in the page that's loaded in the
>> browser.
>
> So where should I put the code instead?

That would depend on what you're trying to do.  You didn't post the .rjs
so
I can't say for sure.  In general, given what you've said, if you want
to
execute javascript on completion of the form submission, I'd say write
the
javascript, put it in application.js, and it'll be available to you on
:complete.

hth,
Bill
34f26dde337f0a0d2d380e11117e82f6?d=identicon&s=25 Vishnu Gopal (Guest)
on 2007-06-18 06:35
(Received via mailing list)
Use a form_remote tag and then post it to the controller. Call an RJS
action from there. That should work.

Vish
Db912f6efe445bc04c923c14c4be5a76?d=identicon&s=25 Max (Guest)
on 2007-06-20 11:21
(Received via mailing list)
> Use a form_remote tag and then post it to the controller. Call an RJS
> action from there. That should work.

Thanks, I solved my initial problem in a completely different way, but
I'll come back to it and try that.
This topic is locked and can not be replied to.