Remote_form_for issue


#1

Hi everybody,

I’m trying to change my current forms in my app to remote_forms. It was
my understanding that remote_form_for and form_for work in the same way,
so I just wanted to change the methods. My code looks like:

<% form_remote_for :post, :url => posts_url do |f| %>
<%= render :partial => ‘form_posts’, :locals => {:f => f} %>
<%= table_submit_tag “Chercher” %>
<% end %>

The problem of this code is that it generates an empty form:

params[:post] is empty (Form.serialize(this) serializes an emtpy
form…). Anyone has an idea what I am missing? I thought it was because
the partial wasn’t passed to the block, but I have the same proble
when I past it. Moreover @post does exist and I have the same problem
without using block, but using form_remote_tag.

The partial is dummy: f.text_field :body

Thanks,


,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================’


#2

what version of rails?
There where some problems with this that helper method in 1.1.6.
However, it should work as is in 1.2.x


#3

On Mon, Jun 04, 2007 at 07:30:11AM +0200, Keynan P. wrote :

what version of rails?
There where some problems with this that helper method in 1.1.6.
However, it should work as is in 1.2.x

Rails 1.2.3

That’s really weird…


,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================’


#4

On Mon, Jun 04, 2007 at 09:05:43AM +0200, Pierre-Alexandre M. wrote :

That’s really weird…

Extracted from http://www.cs.tut.fi/~jkorpela/forms/tables.html#example:
Tables and forms can be nested either way. But if you put forms into
tables, each form must be completely included into a single table cell
(one TD element in practice). Thereby the forms are each completely
independent. See my document on choices in HTML forms for some simple
examples.

It was an HTML problem. Sorry.


,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================’