# Rest and Ajax

**URL:** <https://www.ruby-forum.com/t/rest-and-ajax/85704>\
**Category:** Rails\
**Created:** [February 15, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/rest-and-ajax/85704 "2007-02-15T17:51:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@Meech](https://www.ruby-forum.com/u/Meech)\
**Post date:** [February 15, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/rest-and-ajax/85704/1 "2007-02-15T17:51:38Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Meech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@Meech](https://www.ruby-forum.com/u/Meech)\
**Post date:** [February 15, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/rest-and-ajax/85704/2 "2007-02-15T17:57:39Z")

</div>

On Feb 15, 8:50 am, “Meech” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![Meech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@Meech](https://www.ruby-forum.com/u/Meech)\
**Post date:** [February 15, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/rest-and-ajax/85704/3 "2007-02-15T18:01:39Z")

</div>

but…

\<%= form\_remote\_tag :method=\>:get %\>

still renders as:

\<form method="post"

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