Files
habitica/app/views/habits/_form.html.erb
T
2012-02-01 14:51:19 -05:00

30 lines
774 B
Plaintext

<%= form_for(@habit) do |f| %>
<% if @habit.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@habit.errors.count, "error") %> prohibited this habit from being saved:</h2>
<ul>
<% @habit.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :habit_type %><br />
<%= f.select :habit_type, options_for_select([['Always',1], ['Daily',2], ['One-time',3]], @habit.habit_type) %>
</div>
<div class="field">
<%= f.label :notes %><br />
<%= f.text_area :notes %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>