I think the best way to handle this is to use member routes for the parent controller so that when you create the child you always know which parent it belongs to through routing. For instance:
resources :parents do
member do
post 'create_child'
end
end
And then in your view
<%= form_for @child, :url => create_child_parent_path(@parent) do |f| %>
...
<% end %>
And finally, in your controller
def create_child
@parent = Parent.find(params[:id])
@child = @parent.children.build(params[:child])
if @child.save
@child = Child.new
end
render :action => :show
end
, , parent_id .