I should have included that my method works, but the problem is that I
don't feel it is the most correct way of doing it.
Suggestions?

On Aug 27, 10:15 am, dev2 <[email protected]> wrote:
> Here are my tables
>
> People
> id, name, address
>
> Doctors
> id, person_id, pay_level, experience
>
> The new doctor form (using merb helpers)
>
> form_for(@person, :action(.....)) do
>   ... <!--  GENERATED FORM  -->
> <form>
> <input name='person[name]' value="Steve Smith">
> <input name='person[address]' value="128 Barker Ave">
> <input name='doctor[pay_level]' value='a2'>
> <input name='doctor[experience]' value="128 Barker Ave">
> <input type='submit'>
> </form>
>
> Person controller
> ......
> @person = Person.new(params[:person])
> if @person.save
>    if is_doctor(@person)
>       @doctor = Doctor.new(params[:doctor])
>       if @doctor.save
>          ....
>      end
>    end
> else
> .....
> end
> ......

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to