<div id="poll">
  <%= form_for(@poll, html: { class: 'square' }) do |f| %>
    <%= render 'shared/errors', messages: @poll.errors.full_messages %>

    <div class="fields horizontal">
      <%= f.label :question %>
      <%= f.text_field :question %>
    </div>

    <div class="fields horizontal">
      <%= f.label :end_date %>
      <%= f.datetime_select :end_date, datetime_separator: '', time_separator: '' %>
    </div>

    <h3 class="title">Options</h3>

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

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

    <div class="controls">
      <%= f.submit 'Save' %>
    </div>
  <% end %>
</div>
  