Setup basic workout index action
This commit is contained in:
parent
de37e811f9
commit
cab5cc436e
12 changed files with 84 additions and 54 deletions
3
app/assets/javascripts/workouts.js.coffee
Normal file
3
app/assets/javascripts/workouts.js.coffee
Normal 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/
|
3
app/assets/stylesheets/workouts.css.scss
Normal file
3
app/assets/stylesheets/workouts.css.scss
Normal 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/
|
5
app/controllers/workouts_controller.rb
Normal file
5
app/controllers/workouts_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class WorkoutsController < ApplicationController
|
||||
def index
|
||||
@workouts = Workout.all
|
||||
end
|
||||
end
|
2
app/helpers/workouts_helper.rb
Normal file
2
app/helpers/workouts_helper.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
module WorkoutsHelper
|
||||
end
|
2
app/models/workout.rb
Normal file
2
app/models/workout.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class Workout < ActiveRecord::Base
|
||||
end
|
5
app/views/workouts/index.html.erb
Normal file
5
app/views/workouts/index.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
<ul>
|
||||
<% @workouts.each do |workout| %>
|
||||
<li><%= workout.date %></li>
|
||||
<% end %>
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue