Hi all, i have the following: In the products controller, i need to insert (if it doesn´t exist) the supplier_id in the products table. The reason for this is that when a user is entering a new product, and there isn´t a supplier listed in the select list, it must be included "in the same form". am really lost on how to do that. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
flaubert wrote:> Hi all, > > i have the following: > In the products controller, i need to insert (if it doesn�t exist) the > supplier_id in the products table. > The reason for this is that when a user is entering a new product, and > there isn�t a supplier listed in the select list, it must be included > "in the same form". > > am really lost on how to do that.Is your problem that you do not have all of your valid supplier ids listed in the select list on the product/new view or that the supplier does not exist in the control table (suppliers for instance)? These are two very different problems. -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
the second option... On 3 maio, 21:32, James Byrne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> flaubert wrote: > > Hi all, > > > i have the following: > > In the products controller, i need to insert (if it doesn�t exist) the > > supplier_id in the products table. > > The reason for this is that when a user is entering a new product, and > > there isn�t a supplier listed in the select list, it must be included > > "in the same form". > > > am really lost on how to do that. > > Is your problem that you do not have all of your valid supplier ids > listed in the select list on the product/new view or that the supplier > does not exist in the control table (suppliers for instance)? These are > two very different problems. > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I take it that the person entering the product data is not necessarily aware that the supplier they are using is not already on file. The question is, how does the system determine that instance in your design? In other words, what is entered on the product screen that would tell the controller that the vendor supplier is not yet on file. Row IDs are typically auto-assigned so it seems a dubious proposition that entering a supplier_id not already in the suppliers table is the trigger. -- 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 -~----------~----~----~----~------~----~------~--~---
yeah if they enter a supplier that doesn't exist then create it later [in the action] or immediately using ajax, I'd imagine. -R On Sat, May 3, 2008 at 6:16 PM, flaubert <aflauberts@gmail.com> wrote:> > Hi all, > > i have the following: > In the products controller, i need to insert (if it doesn´t exist) the > supplier_id in the products table. > The reason for this is that when a user is entering a new product, and > there isn´t a supplier listed in the select list, it must be included > "in the same form". > > am really lost on how to do that. > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---
i want to create the supplier immediately using ajax, but how?? Where can I found some examples? what about the supplier form inside the product form? On 5 maio, 01:42, "Roger Pack" <rogerpack2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> yeah if they enter a supplier that doesn''t exist then create it later > [in the action] or immediately using ajax, I''d imagine. > -R > > On Sat, May 3, 2008 at 6:16 PM, flaubert <aflaube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi all, > > > i have the following: > > In the products controller, i need to insert (if it doesn´t exist) the > > supplier_id in the products table. > > The reason for this is that when a user is entering a new product, and > > there isn´t a supplier listed in the select list, it must be included > > "in the same form". > > > am really lost on how to do that.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
flaubert wrote:> i want to create the supplier immediately using ajax, but how?? > Where can I found some examples? what about the supplier form inside > the product form?I think that it would be useful to step back in the process and sketch out what the user has to work with and how this is presented to the system. Questions that come to mid for me are: How come the product data to be entered? Is this upon receipt of goods or in anticipation of an order? How does one come to possess or order goods from an previously unknown supplier? Is there a procedural problem that needs addressing in the business model first? What supplier information does the user possess? What is unique to the supplier? Are supplier codes separate from the surrogate id value assigned? If so then by whom and how are they controlled? If codes are not used then how are duplicate supplier entries prevented? Must the supplier name be unique? Do we have address information? Accounting information? Federal and state tax numbers? Contact information? Before one decides on what and how to add supplier records a bit of time spent on determining on when, why and who seems in order. -- 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 -~----------~----~----~----~------~----~------~--~---
If your user has the name of the supplier but the supplier does not exist in the suppliers table, you might be able to use autocomplete. Check out http://railscasts.com. There was a decent screencast on it recently. On May 5, 5:04 pm, flaubert <aflaube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i want to create the supplier immediately using ajax, but how?? > Where can I found some examples? what about the supplier form inside > the product form? > > On 5 maio, 01:42, "Roger Pack" <rogerpack2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > yeah if they enter a supplier that doesn''t exist then create it later > > [in the action] or immediately using ajax, I''d imagine. > > -R > > > On Sat, May 3, 2008 at 6:16 PM, flaubert <aflaube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi all, > > > > i have the following: > > > In the products controller, i need to insert (if it doesn´t exist) the > > > supplier_id in the products table. > > > The reason for this is that when a user is entering a new product, and > > > there isn´t a supplier listed in the select list, it must be included > > > "in the same form". > > > > am really lost on how to do that.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---