Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create
- @game = Game.new(params[:game])
- if @game.save
- redirect_to edit_player_path (@game.players.first)
- else
- render 'new'
- end
- end
- def update
- @game = current_game
- @player = @game.players.find(params[:id])
- if @player.update_attributes(params[:player])
- redirect_to @game
- else
- render 'edit'
- end
- end
- def current_game
- @current_game ||= Game.find_by_remember_token(cookies[:remember_token])
- end
- root to: 'static_pages#home'
- get "static_pages/home"
- resources :games
- resources :players
- resources :sessions, only: [:new, :create, :destroy]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement