I have a form with some fields. In one of these ones the user can put data of type address, like "example street" and so on. I want that the user can select from a list of streets but these streets are in a table from a Oracle database. I can connect the form field to the street field of the Oracle table? -- 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.
Mauro
2011-May-13 20:31 UTC
Re: how to connect a form field to a table from another database?
On 12 May 2011 17:13, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a form with some fields. > In one of these ones the user can put data of type address, like > "example street" and so on. > I want that the user can select from a list of streets but these > streets are in a table from a Oracle database. > I can connect the form field to the street field of the Oracle table? >no advices? -- 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.
Bryan Crossland
2011-May-14 12:09 UTC
Re: Re: how to connect a form field to a table from another database?
Sent from my iPhone On May 13, 2011, at 3:31 PM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 12 May 2011 17:13, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I have a form with some fields. >> In one of these ones the user can put data of type address, like >> "example street" and so on. >> I want that the user can select from a list of streets but these >> streets are in a table from a Oracle database. >> I can connect the form field to the street field of the Oracle table? >> > > no advices? >The question is pretty basic and answered by any tutorial or Rails guide out there. Yes is the answer. Your controller calls the model for the other table and returns the list of streets to populate a select box on a form. B. -- 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.
Mauro
2011-May-16 08:27 UTC
Re: Re: how to connect a form field to a table from another database?
On 14 May 2011 14:09, Bryan Crossland <bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sent from my iPhone > On May 13, 2011, at 3:31 PM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 12 May 2011 17:13, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I have a form with some fields. > > In one of these ones the user can put data of type address, like > > "example street" and so on. > > I want that the user can select from a list of streets but these > > streets are in a table from a Oracle database. > > I can connect the form field to the street field of the Oracle table? > > > no advices? > > > The question is pretty basic and answered by any tutorial or Rails guide out > there. Yes is the answer. Your controller calls the model for the other > table and returns the list of streets to populate a select box on a form.But how can I associate the model with the preexisting oracle table? -- 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.
Bryan Crossland
2011-May-16 14:50 UTC
Re: Re: how to connect a form field to a table from another database?
Sent from my iPhone On May 16, 2011, at 3:27 AM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 14 May 2011 14:09, Bryan Crossland <bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Sent from my iPhone >> On May 13, 2011, at 3:31 PM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> On 12 May 2011 17:13, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I have a form with some fields. >> >> In one of these ones the user can put data of type address, like >> >> "example street" and so on. >> >> I want that the user can select from a list of streets but these >> >> streets are in a table from a Oracle database. >> >> I can connect the form field to the street field of the Oracle table? >> >> >> no advices? >> >> >> The question is pretty basic and answered by any tutorial or Rails guide out >> there. Yes is the answer. Your controller calls the model for the other >> table and returns the list of streets to populate a select box on a form. > > > But how can I associate the model with the preexisting oracle table? >Create a model that has same name as your table an inherit ActiveRecord for it. Example Table: my_table Model: my_table.rb class MyTable < ActiveRecord::Base end B.> -- > 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. >-- 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.
Paulo Muggler Moreira
2011-May-17 16:30 UTC
Re: Re: how to connect a form field to a table from another database?
The way I understand it, Mauro has his models stored in different databases, i.e., his rails app is running on one DB server (SQLite/PostgreSQL/X) and he wants to fetch data on another DB server (Oracle), is that so? In that case, it would do good to look here: http://api.rubyonrails.org/classes/ActiveRecord/Base.html <http://api.rubyonrails.org/classes/ActiveRecord/Base.html>Under the section "Connection to multiple databases in different models", there''s your answer. Then, there''s this guide, which drills it down a bit more: http://www.messaliberty.com/2009/02/ruby-how-to-use-multiple-databases-with-activerecord/ <http://www.messaliberty.com/2009/02/ruby-how-to-use-multiple-databases-with-activerecord/> regards On Mon, May 16, 2011 at 11:50, Bryan Crossland <bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Sent from my iPhone > > On May 16, 2011, at 3:27 AM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 14 May 2011 14:09, Bryan Crossland <bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Sent from my iPhone > >> On May 13, 2011, at 3:31 PM, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> On 12 May 2011 17:13, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> I have a form with some fields. > >> > >> In one of these ones the user can put data of type address, like > >> > >> "example street" and so on. > >> > >> I want that the user can select from a list of streets but these > >> > >> streets are in a table from a Oracle database. > >> > >> I can connect the form field to the street field of the Oracle table? > >> > >> > >> no advices? > >> > >> > >> The question is pretty basic and answered by any tutorial or Rails guide > out > >> there. Yes is the answer. Your controller calls the model for the other > >> table and returns the list of streets to populate a select box on a > form. > > > > > > But how can I associate the model with the preexisting oracle table? > > > > Create a model that has same name as your table an inherit ActiveRecord for > it. > > Example > Table: my_table > > Model: my_table.rb > > class MyTable < ActiveRecord::Base > > end > > > B. > > > > > -- > > 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. > > > > -- > 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. > >-- 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.
Mauro
2011-May-17 18:02 UTC
Re: Re: how to connect a form field to a table from another database?
On 17 May 2011 18:30, Paulo Muggler Moreira <paulomuggler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The way I understand it, Mauro has his models stored in different databases, > i.e., his rails app is running on one DB server (SQLite/PostgreSQL/X) and he > wants to fetch data on another DB server (Oracle), is that so?Yes it is, thank you for yor answer. I''m trying to connect to a oracle8 db using activerecord-oracle-enhanced and jdbc but I think that this gem has problems with oracle version 8. There is someone that use oracle8 with jdbc in his application? -- 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.