I''m using form_remote_tag to generate a remote form that contains nothing but a hidden_field_tag and a submit_tag. The form appears to be generated correctly (I see the <form> tag and the <input> field with type="hidden" contained in it) and it''s submitted using Ajax to the correct URL, but the hidden field is not sent to the server. Is there any reason this shouldn''t work? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Quoting bigbanger <bigbanger10s-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > I''m using form_remote_tag to generate a remote form that contains > nothing but a hidden_field_tag and a submit_tag. The form appears to > be generated correctly (I see the <form> tag and the <input> field > with type="hidden" contained in it) and it''s submitted using Ajax to > the correct URL, but the hidden field is not sent to the server. Is > there any reason this shouldn''t work? >I am using this in Rails 1.2 and Rails 2.0 and it works fine. Here is the relevant code from my template: <% form_remote_tag(:url=>{:controller=>''comments'', :action=>''add''}, :update=>"comments_#{show.id}", :position=>:bottom) do %> <%= hidden_field_tag(''comment[task_id]'', 0) %> <%= hidden_field_tag(''comment[parent_id]'', show.id) %> <%= submit_tag :reply.l %> <% end %> HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hmm, my code looks pretty much the same as yours (although I''m using RESTful routes). As I said, the HTML appears to be generated correctly, but for some reason the hidden field isn''t being serialized to the server in the Ajax request. I added a request parameter instead and that worked in the interim, but I''m not sure why the hidden field didn''t work... On Dec 21, 6:59 pm, Jeffrey Taylor <r...-NvlhjL+mh2pvqUDvg8NhqHL8HoS0Hn3T@public.gmane.org> wrote:> Quotingbigbanger<bigbanger...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > I''m using form_remote_tag to generate a remote form that contains > > nothing but a hidden_field_tag and a submit_tag. The form appears to > > be generated correctly (I see the <form> tag and the <input> field > > with type="hidden" contained in it) and it''s submitted using Ajax to > > the correct URL, but the hidden field is not sent to the server. Is > > there any reason this shouldn''t work? > > I am using this in Rails 1.2 and Rails 2.0 and it works fine. Here is the > relevant code from my template: > > <% form_remote_tag(:url=>{:controller=>''comments'', :action=>''add''}, > :update=>"comments_#{show.id}", :position=>:bottom) do %> > <%= hidden_field_tag(''comment[task_id]'', 0) %> > <%= hidden_field_tag(''comment[parent_id]'', show.id) %> > > <%= submit_tag :reply.l %> > <% end %> > > HTH, > Jeffrey--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---