remote_form_for not passing form values

I solved it: Don't put your form tag under a <table> tag. Argh.

**Is this a Rails bug? **

Just hit the same issue, i.e. my field attributes were not being passed within a “remote_form_for” that was within a table.

How is one supposed to work around this if you need an AJAX form call within part of a table, and the table is required for the existing layout of the page?

I see that you can put a form in a table, but it has to fit entirely within a table cell (not perfect answer, but better than not being able to use a table at all)

No, it's not a Rails bug - lrn2html. (ref: Tables in HTML documents )

Typically, one puts the table in the form, not the other way around. The HTML spec is pretty specific about what can go inside the table tag without being contained by a cell.

I'd also add, in reference to the original code, that you should be using f.select(:default_view, Account::ROLES) - form_for and friends pass the builder to the block.

--Matt Jones

fair enough - interesting through things worked fine with “form_for”, and it was just when moving to “remote_form_for” the issue kicked in…

fair enough - interesting through things worked fine with
"form_for", and it was just when moving to "remote_form_for" the
issue kicked in...

Probably because with remote_form_for the serialization happens in
javascript. You're going down a different codepath and so the
undefined behaviour may be different.

Fred