Hi everyone, I''m kind of banging my head at this for a while now... I have a 2 phase process in which a list of email addresses and names are retrieved from gmail (for example), displayed to the user, and then he checks the ones he''d like to import. The data displayed to him is not in the database yet, it is just an array of email objects. The problem is I don''t know how to send the entire row of data back to the server - I have multiple checkboxes and I can send them as an array, but how can I send the data as an array of objects (or any other data structure)? I hope I was able to explain the problem... Thanks, Ehud -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 21 Nov 2007, at 17:06, Ehud Rosenberg wrote:> > Hi everyone, > I''m kind of banging my head at this for a while now... > I have a 2 phase process in which a list of email addresses and names > are retrieved from gmail (for example), displayed to the user, and > then > he checks the ones he''d like to import. The data displayed to him is > not > in the database yet, it is just an array of email objects. The problem > is I don''t know how to send the entire row of data back to the > server - > I have multiple checkboxes and I can send them as an array, but how > can > I send the data as an array of objects (or any other data structure)?This may or may not be what you''re asking, but I''ve found that if you have a form with <%= text_field_tag ''foos[][prop1]'' %> <%= text_field_tag ''foos[][prop2]'' %> <%= text_field_tag ''foos[][prop1]'' %> <%= text_field_tag ''foos[][prop2]'' %> Then that gets handled by rails as {:foos => [{''prop1'' => ''value 1'', ''prop2'' => ''value 2''}, {''prop1'' => ''baz'', ''prop2'' => ''bar''}] } Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you want to send data back to server then you need to put it into input fields. How about creating hidden fields as well as displaying the data, or use disabled fields and modifying the style of the field so it doesnt look like an input box Tonypm. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---