Much appreciate any help here. I’m just getting started learning RoR and
setting up my first form is throwing me - I’m not getting the concepts
formalized in my mind.
- Controller is: Donation
- Action is: donation_entry
- Template is: donation_entry.rhtml
This form will be displayed when selected from sidebar menu (which will
always be present for all forms). As such it will be blank for adding a
This form will also be displayed when selecting a donation record from
another form, in which case the record selected will be displayed as
My understanding is that I need a template/form named
donation_entry.rhtml, which I have, but I also need a template/form for
every action in my controller.
I don’t want this.
What I want is this:
User selects Donation from sidebar menu. Blank form is displayed, user
enters data and hits submit. Record is added to the database and form
remains displayed with data just entered as is - allowing updating.
User selects this record off list in another form. Donation_entry form
is displayed with this record. User modifies data and hits submit. The
record is left displayed on form as is - same as when adding a record.
In DonationController, action method donation_entry, couldn’t I do the
following, thus avoiding two or three templates/forms - one for each
action, if I have just the one action of donation_entry:
def donation_entry (in psuedo code)
if save record
In case you are wondering, if the user wanted to immediately add a
second donation record, they would select Donation off the sidebar menu.
I hope this is sufficient information. Any help is very much
Thanks in advance.