Rest and Ajax

I’m trying to do this latest project using Restful techniques, but how
do you deal with Ajax and http POSTs?

I have a helper function that generates a paginated, searchable custom
ajax grid (developed pre-rest). The form_remote_tag really, really
wants to use post. The observe_field wants to post. I had
eventually wanted to use an autocomplete, but that uses post as well.

A post to the “list” url attempts to create a new resource.

How do you all deal with this?

  • Create a ;search/filter type action for the postbacks?
  • Somehow get all these events to use GET?
  • Inspect the post and determine best course of action (feels like a
    total hack)

I’ve been muckin’ around with this but the answer has not jumped out
at me yet.

Thanks in advance…

On Feb 15, 8:50 am, “Meech” [email protected] wrote:

I’m trying to do this latest project using Restful techniques, but how
do you deal with Ajax and http POSTs?

  • Somehow get all these events to use GET?

yes, add a :method => :get in the link_to_remote

but…

<%= form_remote_tag :method=>:get %>

still renders as:

<form method="post"

If the user clicks on the submit buttin – it’s indeed posted.