diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2019-03-13 10:18:45 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2019-03-13 10:18:45 -0400 |
| commit | bcf6445d92f1a57dff0b97bd9309f40b70088448 (patch) | |
| tree | 94d908f819d4e1360b37ea794b26fde4dde81944 /app/controllers | |
| parent | 837537b14b01a8c7504b786e1bbf7a350c21242a (diff) | |
| download | thoughts-bcf6445d92f1a57dff0b97bd9309f40b70088448.tar.gz thoughts-bcf6445d92f1a57dff0b97bd9309f40b70088448.tar.bz2 thoughts-bcf6445d92f1a57dff0b97bd9309f40b70088448.zip | |
Added started/finished on dates to Game
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/admin/games_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/games_controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
| diff --git a/app/controllers/admin/games_controller.rb b/app/controllers/admin/games_controller.rb index 5bc6de9..ee5fe59 100644 --- a/app/controllers/admin/games_controller.rb +++ b/app/controllers/admin/games_controller.rb | |||
| @@ -46,7 +46,7 @@ class Admin::GamesController < Admin::AdminController | |||
| 46 | private | 46 | private |
| 47 | 47 | ||
| 48 | def game_params | 48 | def game_params |
| 49 | params.require(:game).permit(:title, :description, :status, :progress, :score) | 49 | params.require(:game).permit(:title, :description, :status, :progress, :score, :started_on, :finished_on) |
| 50 | end | 50 | end |
| 51 | 51 | ||
| 52 | def set_section | 52 | def set_section |
| diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 490e0b0..8ddcf24 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | class GamesController < ApplicationController | 1 | class GamesController < ApplicationController |
| 2 | def index | 2 | def index |
| 3 | @games = Game.all | 3 | @games = Game.order(started_on: :desc) |
| 4 | 4 | ||
| 5 | if params[:status] | 5 | if params[:status] |
| 6 | @games = @games.where(status: params[:status]) | 6 | @games = @games.where(status: params[:status]) |
