AJAX seems like a good option here. But if you don't want to get into
that and don't mind the whole page being refreshed you could also try
something like this:
- Add a hidden field to your form called "organisation_added" which is
set to false by default.
"organisation_added" to true and post the form.
- Then with Ruby, if params['organisation_added'] is set to true create
a person object using the data that has already been entered (@person =
Person.new(params[:person]) ), and re-render the form.
- params['organisation_added'] == false means the user posted the form
manually, so in that case you can save the person to your DB.