class GameController < ApplicationController def toggle_resting if current_char.resting? if current_char.stop_resting flash[:notice] = "You stop resting. You now have #{current_char.rested_duration} seconds of rest." else flash[:alert] = "Failed to stop resting. Are you sure you're resting?" end else if current_char.start_resting flash[:notice] = "You are now resting." else flash[:alert] = "Failed to start resting. Are you already resting?" end end redirect_to character_path(current_char) end def stop_activity current_char.stop_activity redirect_to locations_path end def finish_activity @results = ActivityProcessor.new(current_char).results end end