Add more workouts functionality and tests
This commit is contained in:
parent
10d4075f48
commit
456a071bf3
8 changed files with 114 additions and 18 deletions
|
@ -1,4 +1,11 @@
|
|||
<%= form_for @workout do |f| %>
|
||||
<% if @workout.errors.any? %>
|
||||
<ul>
|
||||
<% @workout.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<%= f.label :date %>
|
||||
<%= f.text_field :date %>
|
||||
<%= f.submit nil %>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<%= link_to 'Create', new_workout_path %>
|
||||
|
||||
<ul>
|
||||
<% @workouts.each do |workout| %>
|
||||
<li id="workout_<%= workout.id %>">
|
||||
<%= link_to workout.date, workout %> [
|
||||
<%= link_to workout.date, workout %> [
|
||||
<%= link_to 'Edit', edit_workout_path(workout) %> |
|
||||
<%= link_to 'Delete', workout_path(workout),
|
||||
data: { confirm: 'Are you sure?' }, :method => :delete %>
|
||||
]
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
1
app/views/workouts/new.html.erb
Normal file
1
app/views/workouts/new.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= render :partial => 'form' %>
|
Loading…
Add table
Add a link
Reference in a new issue