Hi, I have teo databases. One is called products, the other categories. Basically, I have products and they are linked to a category. Scheme : products : name:string category:references (?) comments:text categories : name:string place_to_recycle_product:string comments:text I don''t know how to link the two databases and what command I need to use to generate the scheme... Could you help me? 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.
On Wed, Sep 21, 2011 at 3:39 PM, Justin D. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I don''t know how to link the two databases and what command I need to > use to generate the scheme... Could you help me?Does this actually have anything to do with Rails? If so, have you gone through any tutorials, particularly ones focused on Rails/ActiveRecord Associations ? Because that would be the place to start :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Well... I''ve read some tutorials and basically, what I had to do was to create a database with the command scaffold. I had to choose :references as the type of one of my table entry... But the thing is I can''t figure which entry to reference to... -- 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.
On Wed, Sep 21, 2011 at 6:21 PM, Justin D. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Well... I''ve read some tutorials and basically, what I had to do was to > create a database with the command scaffold.Sorry, that doesn''t make any sense to me. You might want to step back and document exactly what you''re done so far, and post that and the code for the models you''ve (I''m guessing) created via scaffolding. It would help to know what version of Rails you''re using, as well. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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 22 September 2011 02:21, Justin D. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: Please don''t top post, it makes it difficult to follow the thread. Insert your reply at appropriate points in the previous post. Thanks.> Well... I''ve read some tutorials and basically, what I had to do was to > create a database with the command scaffold. I had to choose :references > as the type of one of my table entry... But the thing is I can''t figure > which entry to reference to...I think the confusion here is that you have said that you have two databases. I suspect that you mean two tables in one database. Is that correct? I suggest that you have a look at the Rails Guides, starting with Getting Started, then ActiveRecord Associations, Routing, and Debugging. I mean a good work through, do not just skim over then. Then (or in parallel) work through some tutorials. railstutorial.org is good and free to use online. Make sure that you have Rails 3 installed and any tutorial you use is for that version of rails. Colin -- gplus.to/clanlaw -- 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.