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 %>
<tr>
<td>
<%= @project.name %>
</td>
</tr>
<tr>
<td>
Current high bid: <
%=number_to_currency(@project.current_bid.nil? ? 0.00 :
@project.current_bid.amount)%><br/>
</td>
</tr>
<tr>
<td>
<%= text_field_tag ''bid_amount''
%><br/>
</td>
</tr>
<tr>
<td>
<%= submit_tag "send bid",
:name=>"confirm"%><br/>
</td>
</tr>
<%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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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"%><br/>...> 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 http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I tried that and came back with the same problem. On Jun 18, 11:31 am, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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"%><br/> > ... > > 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 > http://www.oreilly.com/catalog/9780596510657/ > "Test Driven Ajax (on Rails)" > assert_xpath, assert_javascript, & assert_ajax--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2007-Jun-18 23:29 UTC
Re: form_remote_tag doesn''t pass any form params
Scott wrote:> 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 %> > <tr> > <td> > <%= @project.name %> > </td> > </tr> > <tr> > <td> > Current high bid: < > %=number_to_currency(@project.current_bid.nil? ? 0.00 : > @project.current_bid.amount)%><br/> > </td> > </tr> > <tr> > <td> > <%= text_field_tag ''bid_amount'' %><br/> > </td> > </tr> > <tr> > <td> > <%= submit_tag "send bid", :name=>"confirm"%><br/> > </td> > </tr> > <%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.Wrap your form_remote_tag outside the <table> element rather than inside. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---