= form_for resource, :url => polymorphic_path([:admin, parent, resource]), :remote => request.xhr? do |f| .errors= resource_error_messages! .field = f.label :name, nil, :class => :req = f.text_field :name .field = f.label :template, nil, :class => :req = f.text_field :template = f.fields_for f.object.options do |ff| .field = ff.label :header_text, nil = ff.text_field :header_text %fieldset.poll-answers.nested-associations %legend= f.label(:poll_answers) .fields = render_nested_attribute_association(:poll_answers, f) .actions = link_to_add_nested_attribute(:poll_answers) - unless request.xhr? = render 'shared/admin/region_type_select', :f => f .actions = f.submit -# the js templates for adding fields, it would probably be nice if this was rendered once, perhaps :javascript #{nested_attribute_template_js(Poll, :poll_answers)}