Setup basic workout index action

This commit is contained in:
Andrew Tomaka 2013-08-04 20:58:01 -04:00
parent de37e811f9
commit cab5cc436e
12 changed files with 84 additions and 54 deletions

View file

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View file

@ -0,0 +1,3 @@
// Place all the styles related to the workouts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View file

@ -0,0 +1,5 @@
class WorkoutsController < ApplicationController
def index
@workouts = Workout.all
end
end

View file

@ -0,0 +1,2 @@
module WorkoutsHelper
end

2
app/models/workout.rb Normal file
View file

@ -0,0 +1,2 @@
class Workout < ActiveRecord::Base
end

View file

@ -0,0 +1,5 @@
<ul>
<% @workouts.each do |workout| %>
<li><%= workout.date %></li>
<% end %>
</ul>