ensl.org/app/views/polls/_form.html.erb
2014-04-27 02:35:13 +01:00

32 lines
No EOL
764 B
Text

<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>