Hi to all, I''m starting with ROR, coming from Delphi/Win32, I''m in the process of learning, I know there are many tutorials and books for beginners, but I didn''t find any resources showing : 1. How to build an HTML page where the user can capture de master table data, let''s say Invoice Header (Customer, Date, etc) , and at the same time add records for the detail table (Item ID, Quantity, Price, etc) and finally save all in a single transaction (sumbit?), also including product searching capabilities, is this posible ? May be I''m taking a wrong approach. 2. The samples I''ve found are using screens where the user select directly from a list (of products for example) to build a shopping cart, but the products list I have to manage are from 30,000 products and even more, so It would be nice to have a sample showing how to link a complex search form which can return selected(s) product(s) to the view who called it. 3. Please don''t send me to google, I''ve been there and I did not find any concrete example on this subject and I think I''m not the one looking for something like this, so, it must exist something out there treating this kind of subject, the wheel was already invented I think. If someone can help me with some tutorial/samples I will really appreciate that. I''m not looking for someone who make my job, but coming from a drag & drop world is hard to imagine some things, when I met ROR I can say that almost felt in love, but now I''m trying to do something more complex than a simple scaffold and I really having a hard time with this, but I think I can make an extra effort before watching in another direction. Thanks to all Mocte --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
atpunkt-TM7Dk29TcfyELgA04lAiVw@public.gmane.org
2007-Sep-04 23:07 UTC
Re: Master detail sample for newbie and something more ;-)
This is not a complete answer, but I can give you some pointers how to handle this. (Real RoR-Experts: please complete and correct me). - this sounds like a case for Ajax functionalities - check out rjs on how to change the form without reloading and how to use live-searches to complete the product data - use partials to display the sub-forms - in theses partials use <%= fields_for ... do %> to handle subforms cleanly within the same form - use the empty-bracket []-notation to automatically insert the id of the subform''s model in to the field-name. as I said: just pointers, no solutions. good luck, phil On 4 Sep., 18:22, Mocte <mocte.li...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi to all, > > I''m starting with ROR, coming from Delphi/Win32, I''m in the process of > learning, I know there are many tutorials and books for beginners, but > I didn''t find any resources showing : > > 1. How to build an HTML page where the user can capture de master > table data, let''s say Invoice Header (Customer, Date, etc) , and at > the same time add records for the detail table (Item ID, Quantity, > Price, etc) and finally save all in a single transaction (sumbit?), > also including product searching capabilities, is this posible ? May > be I''m taking a wrong approach. > > 2. The samples I''ve found are using screens where the user select > directly from a list (of products for example) to build a shopping > cart, but the products list I have to manage are from 30,000 products > and even more, so It would be nice to have a sample showing how to > link a complex search form which can return selected(s) product(s) to > the view who called it. > > 3. Please don''t send me to google, I''ve been there and I did not find > any concrete example on this subject and I think I''m not the one > looking for something like this, so, it must exist something out there > treating this kind of subject, the wheel was already invented I think. > If someone can help me with some tutorial/samples I will really > appreciate that. I''m not looking for someone who make my job, but > coming from a drag & drop world is hard to imagine some things, when I > met ROR I can say that almost felt in love, but now I''m trying to do > something more complex than a simple scaffold and I really having a > hard time with this, but I think I can make an extra effort before > watching in another direction. > > Thanks to all > Mocte--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Phil, I will follow your advice, but, Can you tell me where can I find more about this "empty-bracket []-notation" ? Thanks, Mocte P.S. Everybody, I''m still looking for some ready-made samples, anything is very welcome. On 4 sep, 18:07, "atpu...-TM7Dk29TcfyELgA04lAiVw@public.gmane.org" <atpu...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> This is not a complete answer, but I can give you some pointers how to > handle this. > (Real RoR-Experts: please complete and correct me). > - this sounds like a case for Ajax functionalities - check out rjs on > how to change the form without reloading and how to use live-searches > to complete the product data > - use partials to display the sub-forms > - in theses partials use <%= fields_for ... do %> to handle subforms > cleanly within the same form > - use the empty-bracket []-notation to automatically insert the id of > the subform''s model in to the field-name. > > as I said: just pointers, no solutions. > > good luck, > phil > > On 4 Sep., 18:22, Mocte <mocte.li...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi to all, > > > I''m starting with ROR, coming from Delphi/Win32, I''m in the process of > > learning, I know there are many tutorials and books for beginners, but > > I didn''t find any resources showing : > > > 1. How to build an HTML page where the user can capture de master > > table data, let''s say Invoice Header (Customer, Date, etc) , and at > > the same time add records for the detail table (Item ID, Quantity, > > Price, etc) and finally save all in a single transaction (sumbit?), > > also including product searching capabilities, is this posible ? May > > be I''m taking a wrong approach. > > > 2. The samples I''ve found are using screens where the user select > > directly from a list (of products for example) to build a shopping > > cart, but the products list I have to manage are from 30,000 products > > and even more, so It would be nice to have a sample showing how to > > link a complex search form which can return selected(s) product(s) to > > the view who called it. > > > 3. Please don''t send me to google, I''ve been there and I did not find > > any concrete example on this subject and I think I''m not the one > > looking for something like this, so, it must exist something out there > > treating this kind of subject, the wheel was already invented I think. > > If someone can help me with some tutorial/samples I will really > > appreciate that. I''m not looking for someone who make my job, but > > coming from a drag & drop world is hard to imagine some things, when I > > met ROR I can say that almost felt in love, but now I''m trying to do > > something more complex than a simple scaffold and I really having a > > hard time with this, but I think I can make an extra effort before > > watching in another direction. > > > Thanks to all > > Mocte--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
atpunkt-TM7Dk29TcfyELgA04lAiVw@public.gmane.org
2007-Sep-04 23:38 UTC
Re: Master detail sample for newbie and something more ;-)
it''s not much but it''s mentioned on this page: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html (right above the blue header reading "Methods") P On 5 Sep., 01:24, Mocte <mocte.li...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Phil, > > I will follow your advice, but, Can you tell me where can I find more > about this "empty-bracket []-notation" ? > > Thanks, > Mocte > > P.S. Everybody, I''m still looking for some ready-made samples, > anything is very welcome. > > On 4 sep, 18:07, "atpu...-TM7Dk29TcfyELgA04lAiVw@public.gmane.org" <atpu...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > This is not a complete answer, but I can give you some pointers how to > > handle this. > > (Real RoR-Experts: please complete and correct me). > > - this sounds like a case for Ajax functionalities - check out rjs on > > how to change the form without reloading and how to use live-searches > > to complete the product data > > - use partials to display the sub-forms > > - in theses partials use <%= fields_for ... do %> to handle subforms > > cleanly within the same form > > - use the empty-bracket []-notation to automatically insert the id of > > the subform''s model in to the field-name. > > > as I said: just pointers, no solutions. > > > good luck, > > phil > > > On 4 Sep., 18:22, Mocte <mocte.li...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi to all, > > > > I''m starting with ROR, coming from Delphi/Win32, I''m in the process of > > > learning, I know there are many tutorials and books for beginners, but > > > I didn''t find any resources showing : > > > > 1. How to build an HTML page where the user can capture de master > > > table data, let''s say Invoice Header (Customer, Date, etc) , and at > > > the same time add records for the detail table (Item ID, Quantity, > > > Price, etc) and finally save all in a single transaction (sumbit?), > > > also including product searching capabilities, is this posible ? May > > > be I''m taking a wrong approach. > > > > 2. The samples I''ve found are using screens where the user select > > > directly from a list (of products for example) to build a shopping > > > cart, but the products list I have to manage are from 30,000 products > > > and even more, so It would be nice to have a sample showing how to > > > link a complex search form which can return selected(s) product(s) to > > > the view who called it. > > > > 3. Please don''t send me to google, I''ve been there and I did not find > > > any concrete example on this subject and I think I''m not the one > > > looking for something like this, so, it must exist something out there > > > treating this kind of subject, the wheel was already invented I think. > > > If someone can help me with some tutorial/samples I will really > > > appreciate that. I''m not looking for someone who make my job, but > > > coming from a drag & drop world is hard to imagine some things, when I > > > met ROR I can say that almost felt in love, but now I''m trying to do > > > something more complex than a simple scaffold and I really having a > > > hard time with this, but I think I can make an extra effort before > > > watching in another direction. > > > > Thanks to all > > > Mocte--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Adam Cohen
2007-Sep-04 23:48 UTC
Re: Master detail sample for newbie and something more ;-)
On 9/4/07, atpunkt-TM7Dk29TcfyELgA04lAiVw@public.gmane.org <atpunkt-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > > > > I''m starting with ROR, coming from Delphi/Win32, I''m in the process of > > > > learning, I know there are many tutorials and books for beginners, but > > > > I didn''t find any resources showing : > > > > > > 1. How to build an HTML page where the user can capture de master > > > > table data, let''s say Invoice Header (Customer, Date, etc) , and at > > > > the same time add records for the detail table (Item ID, Quantity, > > > > Price, etc) and finally save all in a single transaction (sumbit?), > > > > also including product searching capabilities, is this posible ? May > > > > be I''m taking a wrong approach.when I''ve had to implement a master/detail view in a rails project, I''ve used a partial for the master list which I can paginate and filter using ajax, and a partial for the detail view which can be updated/saved/edited using ajax as well. I use the will_paginate plugin for the pagination (with a little bit of added code to take care of the ajax part - if you search through the tickets on the will_paginate issue tracker at err.lighthouseapp.com you''ll find some patches for adding ajax functionality to the plugin) The form is just a case of using form_remote_tag (or form_remote_for) and then possibly re-rendering the master list.> > > > 2. The samples I''ve found are using screens where the user select > > > > directly from a list (of products for example) to build a shopping > > > > cart, but the products list I have to manage are from 30,000 products > > > > and even more, so It would be nice to have a sample showing how to > > > > link a complex search form which can return selected(s) product(s) to > > > > the view who called it.not sure what you''re trying to do here. Are you trying to display a form which allows you to filter/search through your massive product list, and then add a single item to a cart? This type of thing doesn''t need ajax, although you can use it if you want. Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, I''m just wan to say thank you all, I''m investigating with your advices. Regards, Mocte On 4 sep, 18:48, "Adam Cohen" <bionicboo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 9/4/07, atpu...-TM7Dk29TcfyELgA04lAiVw@public.gmane.org <atpu...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > > > > I''m starting with ROR, coming from Delphi/Win32, I''m in the process of > > > > > learning, I know there are many tutorials and books for beginners, but > > > > > I didn''t find any resources showing : > > > > > > 1. How to build an HTML page where the user can capture de master > > > > > table data, let''s say Invoice Header (Customer, Date, etc) , and at > > > > > the same time add records for the detail table (Item ID, Quantity, > > > > > Price, etc) and finally save all in a single transaction (sumbit?), > > > > > also including product searching capabilities, is this posible ? May > > > > > be I''m taking a wrong approach. > > when I''ve had to implement a master/detail view in a rails project, > I''ve used a partial for the master list which I can paginate and > filter using ajax, and a partial for the detail view which can be > updated/saved/edited using ajax as well. I use the will_paginate > plugin for the pagination (with a little bit of added code to take > care of the ajax part - if you search through the tickets on the > will_paginate issue tracker at err.lighthouseapp.com you''ll find some > patches for adding ajax functionality to the plugin) > > The form is just a case of using form_remote_tag (or form_remote_for) > and then possibly re-rendering the master list. > > > > > > 2. The samples I''ve found are using screens where the user select > > > > > directly from a list (of products for example) to build a shopping > > > > > cart, but the products list I have to manage are from 30,000 products > > > > > and even more, so It would be nice to have a sample showing how to > > > > > link a complex search form which can return selected(s) product(s) to > > > > > the view who called it. > > not sure what you''re trying to do here. Are you trying to display a > form which allows you to filter/search through your massive product > list, and then add a single item to a cart? This type of thing > doesn''t need ajax, although you can use it if you want. > > Adam--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mocte wrote:> Hi, > > I''m just wan to say thank you all, I''m investigating with your > advices. > > Regards, > MocteHi all, I am also looking for some advices on how to make a master-details form which allow the user to update the data of both the master table and the detail table. I found one solution demonstrated by Unsapce..here is the link: http://unspace.ca/datagrid/update It make use of the "onblur" event to invoke an javascript, the javascript then submit an Ajax.Request to run an "action". One technique it used is to embed the IDs of the detail rows in an hidden field rendered on the screen. I used the same approach which really works, the only draw back is that it need quite a lot of coding to complete the whole form. I just want to ask if some one has other solution for master-detail-form applcation. Thanks! -- 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-/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.