# Form\_remote\_for NOT passing param: I want put and I get post

**URL:** <https://www.ruby-forum.com/t/form-remote-for-not-passing-param-i-want-put-and-i-get-post/159992>\
**Category:** Rails\
**Created:** [February 10, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/form-remote-for-not-passing-param-i-want-put-and-i-get-post/159992 "2009-02-10T19:40:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [February 10, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/form-remote-for-not-passing-param-i-want-put-and-i-get-post/159992/1 "2009-02-10T19:40:30Z")

</div>

Hello,

I’m struggling my brain with this ajax issue …

Basically I have a form for creating records, and I want to submit it  
using Ajax.

On previous versions of RoR (2.0.2) it was working, but the same methods  
doesn’t work on 2.2.2, and I started to make changes and changes and  
read forums and the api, but no way …

\<% form\_remote\_for (:expedient, :url =\> {:action =\> ‘create\_ajax’},  
:update =\>‘div\_listd’) do |f| %\>

| Referencia | \<%= f.text\_field :reference %\> | \<%= submit\_tag "AÃ±adir" %\> |

\<% end %\>

In the development.log I only see the token param:  
Parameters:  
{“authenticity\_token”=\>“c5fb066b9a3370e15f94154cc2140759d40f079c”}

the html source code is this:

| Referencia | | |

I see that the method is post, I think it should be ‘PUT’ to pass the  
variables in the params … or I’m wrong in this assumption ?

I tried to add the :method =\> :put but no way … sure I put it in the  
wrong place 🙂

thanks again!

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [February 10, 2009, 10:05pm UTC](https://www.ruby-forum.com/t/form-remote-for-not-passing-param-i-want-put-and-i-get-post/159992/2 "2009-02-10T22:05:30Z")

</div>

On 10 Feb 2009, at 18:40, Raimon Fs wrote:

> doesn’t work on 2.2.2, and I started to make changes and changes and  
> read forums and the api, but no way …

Random guesses: assuming that the page contains more than just this:

- are all dom ids unique
- have you got nested forms ?

Fred

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [February 10, 2009, 11:08pm UTC](https://www.ruby-forum.com/t/form-remote-for-not-passing-param-i-want-put-and-i-get-post/159992/3 "2009-02-10T23:08:13Z")

</div>

Frederick C. wrote:

> On 10 Feb 2009, at 18:40, Raimon Fs wrote:
> 
> > doesn’t work on 2.2.2, and I started to make changes and changes and  
> > read forums and the api, but no way …
> 
> Random guesses: assuming that the page contains more than just this:
> 
> - are all dom ids unique
> - have you got nested forms ?
> 
> Fred

Here is the .erb file:

\<% form\_remote\_for (:expedient, :method =\> :put, :url =\> {:action =\>  
‘create\_ajax’}, :update =\>‘div\_listd’) do |f| %\>  
\<%= f.error\_messages %\>

| Referencia | \<%= f.text\_field :reference %\> | \<%= submit\_tag "AÃ±adir" %\> |

\<% end %\>

  

# Expedientes listos para ser enviados

 \<%= render :partial =\> "list" %\>

\<%= link\_to ‘General’, :action =\> ‘index’ %\> |  
\<%= link\_to ‘Back’, expedients\_path %\>
