Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Last active December 17, 2015 18:29
Show Gist options
  • Save telagraphic/5653700 to your computer and use it in GitHub Desktop.
Save telagraphic/5653700 to your computer and use it in GitHub Desktop.
<tr>
<% if workout.persisted? %>
<td><%= time_ago_in_words(workout.created_at) %> ago</td>
<td><%= link_to workout.workouttype, edit_workout_path(workout) %></td>
<td><%= workout.reps %></td>
<td><%= workout.desc %></td>
<td><%= link_to 'remove', workout, confirm: 'Sure?', method: 'delete' %></td>
<% end %>
</tr>
def new
@workout = current_user.workouts.build
@workouts = current_user.workouts.paginate(:page => params[:page], :per_page => 30)
end
<div class='span12'>
<table class='table table-bordered'>
<%= will_paginate %>
<tbody>
<%= render @workouts %>
</tbody>
<%= will_paginate %>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment