Form_remote_tag doesn't pass any form params

I have a simple form_remote_tag like so:

<% form_remote_tag(:url => {:controller => :contractor, :action =>
“bid_on_project”, :project => @project},
:success =>
“javascript:window.opener.location.reload();javascript:window.close()”)
do %>



<%= @project.name %>




Current high bid: <
%=number_to_currency(@project.current_bid.nil? ? 0.00 :
@project.current_bid.amount)%>





<%= text_field_tag ‘bid_amount’ %>





<%= submit_tag “send bid”, :name=>“confirm”%>



<%end%>

However, when I submit the form, all I see is:

Parameters: {“project”=>“1”, “action”=>“bid_on_project”,
“controller”=>“contractor”}

The bid_amount param never seems to make it in on the list.

When I use a regular form_tag, this works fine.

Anyone have any ideas?

Thanks,

Scott

Scott wrote:

<% form_remote_tag(:url => {:controller => :contractor, :action =>
“bid_on_project”, :project => @project},
:success =>
“javascript:window.opener.location.reload();javascript:window.close()”)
do %>

<%= submit_tag “send bid”, :name=>“confirm”%>


The bid_amount param never seems to make it in on the list.

I don’t know the complete story, but we took the remote out of the
form_tag, and used submit_to_remote. It stands to reason that the Ajax
now fires from a button. Also, going forward, submit_to_remote fixes
the problem of multiple submits from one form via Ajax.


Phlip
Test Driven Ajax (on Rails) [Book]
“Test Driven Ajax (on Rails)”
assert_xpath, assert_javascript, & assert_ajax

I tried that and came back with the same problem.

Scott wrote:

    </td>
        <%= text_field_tag 'bid_amount' %><br/>

Parameters: {“project”=>“1”, “action”=>“bid_on_project”,
“controller”=>“contractor”}

The bid_amount param never seems to make it in on the list.

When I use a regular form_tag, this works fine.

Wrap your form_remote_tag outside the

element rather than
inside.


We develop, watch us RoR, in numbers too big to ignore.