##show model
class Show < ActiveRecord::Base
has_many :pictures

accepts_nested_attributes_for :pictures, :allow_destroy => true
end

##picture model
class Picture < ActiveRecord::Base
belongs_to :show
end

##show controller
def new
@show = Show.new
@show.pictures.build

respond_to do |format|
format.html # new.html.erb
format.json { render :json => @show }
end
end

##form
<%= form_for(@show) do |f| %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>

<% f.fields_for :pictures do |picture_form| %>
<div class="field">
<%= picture_form.label :name %>
<br />
<%= picture_form.text_field :name %>
</div>
<% end %>

<div class="field">
<%= f.label :notes %><br />
<%= f.text_area :notes %>
</div>

<div class="actions">
<%= f.submit %>
</div>
<% end %>