Hi, all I''ve trying to look for answers for my problem but so far couldn''t find one, hopefully someone can tell me what to do. In my application, I have to let user can create new table, and they can add or delete columns. The tables they created, I can''t do things that RoR usually can do, like ( Table.find_by_id ), because they are not modeled. Is there any way that I can setup model for a table that user created on fly? Thanks for your help! The code I used to create table is like this: ActiveRecord::Base.connection.create_table :table_name do |t| t.column :name, :string end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You might find Dr Nic''s magic models to be of interest: http:// magicmodels.rubyforge.org/dr_nic_magic_models/ Fred On 12 Oct 2007, at 15:07, Nick wrote:> > Hi, all > I''ve trying to look for answers for my problem but so far couldn''t > find one, hopefully someone can tell me what to do. In my application, > I > have to let user can create new table, and they can add or > delete columns. The tables they created, I can''t do things that RoR > usually > can do, like ( Table.find_by_id ), because they are not modeled. Is > there any > way that I can setup model for a table that user created on fly? > Thanks for your help! > > > The code I used to create table is like this: > ActiveRecord::Base.connection.create_table :table_name do |t| > t.column :name, :string > end > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nic''s magic is amazing. Thank you so much, Fred! On Oct 12, 10:44 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You might find Dr Nic''s magic models to be of interest: http:// > magicmodels.rubyforge.org/dr_nic_magic_models/ > > Fred > > On 12 Oct 2007, at 15:07, Nick wrote: > > > > > > > Hi, all > > I''ve trying to look for answers for my problem but so far couldn''t > > find one, hopefully someone can tell me what to do. In my application, > > I > > have to let user can create new table, and they can add or > > delete columns. The tables they created, I can''t do things that RoR > > usually > > can do, like ( Table.find_by_id ), because they are not modeled. Is > > there any > > way that I can setup model for a table that user created on fly? > > Thanks for your help! > > > The code I used to create table is like this: > > ActiveRecord::Base.connection.create_table :table_name do |t| > > t.column :name, :string > > end- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---