http://weblog.rubyonrails.org/2009/1/26/nested-model-forms
This post helped in learning how to handle multiple models in a rails form. It works as long as the models ar
Two options:
First is ActivePresenter which works well for this.
Second is just to use fields_for
:
<%= form_for @user do |f| %>
<%=f.label :name %>
<%=f.text_field :name %>
<%= fields_for @address do |fa| %>
<%=fa.label :city %>
<%=fa.text_field :city %>
<% end %>
<% end %>
Then in the controller, save the records.
@user = User.new(params[:user])
@address = Address.new(params[:address])
ActivePresenter works so well though.
Also found a railsforum post via Google, which would work well.
You can refer this tutorial by The Pragmatic Programmers
Advanced Rails Recipes