Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
creating dynamic models
6 Posts
creating dynamic models

Hello Experts,

in my ruby on rails application i need to create models(i.e tables) dynamically and the columns in tables are to be created dynamically.

can any one explain how can i reach this requirement..

Thank You, Uma.

Person
goz
Sign In To Rate Post

Uma, can you give a more specific description of what you're trying to accomplish? An example would be very helpful.

Just echoing Adam's request - more info required. Specifically, by "create dynamically" - do you mean at runtime?

Then, assuming yes, what problem is this solution of "create tables dynamically at runtime" trying to solve? I ask because it's the sort of solution which an inexperienced person might come to for a problem that there are much simpler/better solutions for. So it might be better to explain the problem and get the minds here to suggest solutions (which may or may not be to create tables dynamically).

Thanks to all for giving reply,

I am working on sports web application. in that from admin section administrator is going to create different sports(i.e cricket, fottball....). for that i am trying to create table dynamically for each sport with different columns. as the columns names vary from sport to sport. as per the above requirement i am trying to create models and tables dynamically.

can any have ant idea on this requirement. suggestions are accepted..

Thank You, Uma.

hi Uma you can use acts_as_customizable plugin to do so, check out this url http://github.com/trappist/acts_as_customizable/tree/master

Person
goz
Sign In To Rate Post
6 Posts
Login to add your message