-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy path_form.html.erb
42 lines (35 loc) · 988 Bytes
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<%= form_with(model: @activity) do |form| %>
<% if @activity.errors.any? %>
<div style="color: red">
<h2><%= pluralize(@activity.errors.count, "error") %> prohibited this activity from being saved:</h2>
<ul>
<%= @activity.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :title, style: "display: block" %>
<%= form.text_field :title %>
</div>
<div>
<%= form.label :activity_type, style: "display: block" %>
<%= form.text_field :activity_type %>
</div>
<div>
<%= form.label :start, style: "display: block" %>
<%= form.datetime_field :start %>
</div>
<div>
<%= form.label :duration, style: "display: block" %>
<%= form.text_field :duration %>
</div>
<div>
<%= form.label :calories, style: "display: block" %>
<%= form.number_field :calories %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>