Class: GamesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- GamesController
- Defined in:
- app/controllers/games_controller.rb
Instance Method Summary collapse
- #demo_game ⇒ Object
-
#index ⇒ Object
GET /games or /games.json.
- #show ⇒ Object
Instance Method Details
#demo_game ⇒ Object
19 20 21 |
# File 'app/controllers/games_controller.rb', line 19 def demo_game @game = Game.find(params[:id]) end |
#index ⇒ Object
GET /games or /games.json
5 6 7 8 |
# File 'app/controllers/games_controller.rb', line 5 def index @games = Game.where("id != -1") @current_user = User.find(session[:user_id]) if session[:user_id] end |
#show ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/controllers/games_controller.rb', line 10 def show @game = Game.find(params[:id]) begin redirect_to send(@game.game_path) rescue NoMethodError redirect_to games_path, alert: "Game path not found." end end |