views:

47

answers:

2

I'm creating an admin tool for a project where I create an Event, then create multiple Speakers (on one page), then need to create multiple Talks for each Speaker.

Rather than have all the Speakers listed on one page after creation, and then put multiple Talks against each Speaker (which looks crazy due to all the input boxes), I'd like to gradually step through each Speaker, create the Talks for each Speaker, then move on to the next Speaker until all Speakers have been completed.

What's the best way to go about achieving this?

Do I need to create an array of all the created Speakers, then step through it somehow? Or set a flag on each created Speaker, so that once the user has clicked 'save talks' it finds the next speaker (in this event) that hasn't been saved?

A: 

I suggest reading this:

http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials

and afterwards:

http://www.sapphiresteel.com/How-To-Create-a-Ruby-On-Rails-Blog

after that lecture you will bea ble to solute that Problem in a "best-practise" Way.

Since your Question is a basic one i would like to show you that Tutorials. No offense...but i think this lecture helps you more.

bastianneu
Thanks for your suggestions bastianneu - no offence taken!I've progressed a bit from the basic tutorial stages - having worked my way through the AWDR book, a chunk of the Rails Way, and have built a number of (working!) production Rails apps.I'm not asking the basics of creating each of the elements, I'm asking the best way to step through the creation.Having had a bit more of a think, I might start playing with State Machines and see if that helps.
Les
thank you for that comment. It really clears up some of my thougts looking through your question. State Machines sound like a good point to solute that problem.
bastianneu
A: 

Further to my comment to bastianneu, I've spent about 10 minutes with AASM (http://github.com/rubyist/aasm) and have got it doing exactly what I needed.

Sometimes I guess you need to type out your question to properly clear it in you brain :)

Les