Forum: Ruby on Rails Update specific div using post request.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3548d30217e9921c410db19ce8ce38d0?d=identicon&s=25 Sunny Bogawat (sunny_bogawat)
on 2009-01-07 16:53
It is possible to update specific div in my rhtml file using post
request like ajax do?
989aa38adf6609c302f172655bb940d9?d=identicon&s=25 Nirav Parekh (Guest)
on 2009-01-09 10:33
(Received via mailing list)
It is possible to update a specific div using a post request like AJAX
you need to use link_to_remote method for this.

What does this link_to_remote method does...

Returns a link to a remote action defined by options[:url] (using the
url_for format) that's called in the background using XMLHttpRequest.
result of that request can then be inserted into a DOM object whose id
be specified with options[:update]. Usually, the result would be a
prepared by the controller with render :partial.
(from apis)

link_to_remote ("Delete", :update=>"posts", :url=> {:action =>"destroy",

the above function call will generate a link called Delete which when
will delete the item specified by the id and simultaneously update the
having the id "posts" without reloading the page.

link_to_remote requests are posts so don't need to worry about it.
This topic is locked and can not be replied to.