I know you can use form_remote_tag to help create degradable form tags
but what about links? Seems it may be doable, not sure actually, with
some combination of a regular anchor element and a remote_function call
but I would be surprised if there wasn’t a more idiometric aproach?
The onclick event does the ajax call and stops the default behaviour
(requesting the page pointed at by href=“”). If Javascript is disabled,
the normal href=“” target is requested as the behaviour is not stopped
by JavaScript…
could be wrong though, didnt do much ajax yet and not at my machine at
the moment. …
You should check out the Unobstructive Javascript (UJS) plugin
(http://www.ujs4rails.com/) it has helpers that do this kind of thing
properly (and more). The guys behind it also gave a nice presentation
about it at railsconf europe, you can grab the slides from their
presentation off the same website