Hello all, I''m in my second day of working through the various Ruby on Rails tutorials, I''m already hugely impressed by the potential speed of developing database driven sites, especially via the use of scaffolds. Which brings me on to my first question (apologies if it''s a simple one, but like I said it is only my second day!) I am aiming to develop an application that serves a user with a set number of multiple choice questions, chosen from a random set stored in MySQL. Is there an existing scaffold, or close fit, that I could use to rapidly develop this application? Many thanks for your help. -- Posted via http://www.ruby-forum.com/.
No, scaffolding is for creating simple interfaces for your models. You will have to create the database tables to suit and then run your scaffold, then work out your logic for displaying the questions randomly. ------------- Timothy Johnson www.foundinteractive.com On Jun 26, 2006, at 8:28 AM, Jon Hadley wrote:> Hello all, > > I''m in my second day of working through the various Ruby on Rails > tutorials, I''m already hugely impressed by the potential speed of > developing database driven sites, especially via the use of scaffolds. > > Which brings me on to my first question (apologies if it''s a simple > one, > but like I said it is only my second day!) > > I am aiming to develop an application that serves a user with a set > number of multiple choice questions, chosen from a random set stored in > MySQL. > > Is there an existing scaffold, or close fit, that I could use to > rapidly > develop this application? > > Many thanks for your help. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks Timothy, makes sense. Is there a list of available scaffolds? Or are they all based on specific database table layouts? -- Posted via http://www.ruby-forum.com/.
Yes, the scaffold command just looks at your DB tables, and creates the interface accordingly. ------------- Timothy Johnson www.foundinteractive.com On Jun 26, 2006, at 8:39 AM, Jon Hadley wrote:> Thanks Timothy, makes sense. > > Is there a list of available scaffolds? Or are they all based on > specific database table layouts? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
njmacinnes@gmail.com
2006-Jun-26 14:12 UTC
[Rails] Re: Multiple choice questions scaffold?
I think you''re misunderstanding scaffolds. There are no different scaffolds for different tasks. All a scaffold does is list all the records in a given table. For example, if you have a table called "questions", you would use ''ruby script/generate scaffold Question''. The scaffold would generate a list of all the questions in the table, and give an interface for adding, deleting and editing them. So in the infamous rails video with the blog, when he typed ''script/generate scaffold blog'', that''s because the table was called ''blogs'', not because there''s a built in scaffold for making a blog. The scaffold can be very easily adapted for making some things very simple applications, such as a blog, but for anything else, it''s just a starting point. Hope this helps. -Nathan On 26/06/06, Jon Hadley <jon.hadley@gmail.com> wrote:> Thanks Timothy, makes sense. > > Is there a list of available scaffolds? Or are they all based on > specific database table layouts? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >