Forum: Ruby on Rails render() call that does AJAX request?

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.
Wes G. (Guest)
on 2006-04-19 23:36
All,

I have a page where I was using link_to_remote to do an AJAX call to
dynamically update another part of the page.

I'd like to just do the update no matter what (e.g. take out the need
for the user to click).

So I'm thinking that I need to render, but I want my render to do an
AJAX request to the same controller method that my link_to_remote did.

How can I achieve that?

Thanks,
Wes
Manoj K. (Guest)
on 2006-04-20 08:13
You could do something like this, this will default to the action in the
same controller.

render(:action => "my_action")

Thanks
Manoj


Wes G. wrote:
> All,
>
> I have a page where I was using link_to_remote to do an AJAX call to
> dynamically update another part of the page.
>
> I'd like to just do the update no matter what (e.g. take out the need
> for the user to click).
>
> So I'm thinking that I need to render, but I want my render to do an
> AJAX request to the same controller method that my link_to_remote did.
>
> How can I achieve that?
>
> Thanks,
> Wes
This topic is locked and can not be replied to.