Hiya''ll. I''m trying to create an ajaxy form full of intersect values in which each intersect-field can be edited (in place style) and submitted back on change. I have 3 models :people (name) :wants (name) :people_wants (person_id, want_id, importance) #importance of this want for this person, if at all. I want to spit out a grid effectively with people along the top and wants down the side, and in the intersect spots have an in-place-edit field for the "importance" value (if there is one, otherwise it will be created when an importance value is entered). Any suggestions as to how to structure the form so each intersect field is aware of its person_id and it''s want_id and this is passed back on the XHR for updating? Thanks Peter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 3, 2010 at 7:20 AM, ptorrsmith <ptorrsmith-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Any suggestions as to how to structure the form so each intersect > field is aware of its person_id and it''s want_id and this is passed > back on the XHR for updating?Add something to each cell as you generate it which corresponds to the column and row the cell is in. If you want to do it the html5 way, you can add data-attributes as you generate the table - which semantically would be the best bet. If you don''t want to go that way, add a class to each cell, one for each column (you work out the row by just looking at the class of the nearest parent tr), then get your cell to work out what classes it has as they are updated. Mikel -- http://lindsaar.net/ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Mikel. Thanks for that... the HTML5 way looks good, though for the initial version may just go the class route :-) Thanks Peter On Mar 3, 12:22 pm, Mikel Lindsaar <raasd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wed, Mar 3, 2010 at 7:20 AM, ptorrsmith <ptorrsm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Any suggestions as to how to structure the form so each intersect > > field is aware of its person_id and it''s want_id and this is passed > > back on the XHR for updating? > > Add something to each cell as you generate it which corresponds to the > column and row the cell is in. > > If you want to do it the html5 way, you can add data-attributes as you > generate the table - which semantically would be the best bet. > > If you don''t want to go that way, add a class to each cell, one for > each column (you work out the row by just looking at the class of the > nearest parent tr), then get your cell to work out what classes it has > as they are updated. > > Mikel > > --http://lindsaar.net/-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.