<%= form_for(@poll) do |f| %> <%= f.error_messages %>

<%= f.label :question %>
<%= f.text_field :question %>

<%= f.label :end_date %>
<%= f.datetime_select :end_date %>


Options

<%= f.fields_for :options do |opt| %> <%= render "option", :f => opt %> <% end %>

<%= link_to_add_fields "Add an Option", f, :options %>

<%= f.submit 'Save' %>

<% end %> <%= link_to 'Back', polls_path %>