I'd have to agree with Ar Chron, it sounds like you need the PickAxe
book from the PragProg publishers, along with AWDwR - both of which
should be required reading for noobs. Personally, I went on a turbo
learnig curve and went on after those two books with Metaprogramming
Ruby, again from Dave & Andy @ PragProg, and haven't looked back.
It does depend on your knowledge level though. Don't try and run
before you can walk. If you are from a OO background then get stuck in
and make sure you checkout Meta...Ruby. If you are new to OO, then
take your time with the PickAxe book and AWDwR, once you 'think' you
understand those, then maybe move on to Meta...Ruby => you can always
step back if you need to.....
As a reult of Meta...Ruby, I have just refactored 100's of lines of
biolerplate crap (due to the point I was at in my learning curve with
my initial learning project) to a few Ruby modules containing no more
than 50 lines of code each - Ruby is a great language (thanks Matz :))
and it is well worth learning its basics first in order to move on
after that..........take some time learning to Jog on the spot, after
a while you will find yourself sprinting the 100m's in under 8
You seem to have your RoR terms mixed up a bit. Forget about the
'scaffold' as such. That is what the generator creates at your command
in order to provide you with a starting point for your application -
none of it is written in stone - all of it can be tweaked, changed, re-
written. Don't forget, you can generate models, migrations, etc. All
that the generator is, is Ruby code that creates files based on the
Rails Framework to save you the job of creating those files manually.
The generator created scaffold includes, most imprortantly (in my
eyes); your controllers, your models and your migrations. Also created
are your Views and test beds. Personally, I don't care about the
Views, because I use Flex for the front end which connects to RoR via
Flash's RemoteObject and RubyAMF. I hold my hand up to say I need to
look more into the test files (fixtures, unit, helpers, etc) myself.
Haven't found the need for those yet due to creating EXE's that test
my DB and server functionality - they may save me some work as per
most of the RoR framework - just need to find the ROI for the learning
Your 'Submit' action has nothing to do with your scaffold, other than,
presumably, your submit button in your generated scaffold View. Your
original question sounds like the following:
User accesses and fills in the form
User submits the form
Administrator (of sorts) receives notification the form has been
Administrator accepts or dismisses the submitted form
If so, then all you need to do, is to set up your DB to accept new
submissions. You can then decide how you want your Administrator to be
notified : this would depend on Application/Business/Project specific
directives - Admin logs in and downloads latest submissions written to
the DB, latest submissions get written to a log file that the Admin
can access, Admin gets e-mail confirming latest submission etc.
Is this correct?