How to use
link_to or 'button_to' as you normally would, passing the
:remote => true option when you want the form or the link to be submitted using an XMLHttpRequest and the results of the request evaled in the context of the page.
What it does
button_toso that they emit HTML5-like tags with
data-*attributes and evaluates the response in the context of the page. (jQuery 1.4 required)
What it doesn't do
It doesn't support any of the
It only accepts
link_to. If you need an element that looks like a link but updates or destroys a resource, the use
button_toand style the button with CSS to look like a link.
It should be trivial to write your own
remotable.js and drop it in as a replacement for
The following gist provides a sample implementation for Prototype 1.6 and jQuery 1.3.2 (with livequery)
button_to_remoteto use remotable
Copyright (c) 2010 Christos Zisopoulos, released under the MIT license