summaryrefslogtreecommitdiff
path: root/app/controllers/activities_controller.rb
blob: 934f617aa9a922e7047e00edf12d42ae3e3a1ebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class ActivitiesController < ApplicationController
  def show
    @activity = Activity.find(params[:id])
  end

  def start
    @activity = Activity.find(params[:id])
    if current_char.can_do_activity?(@activity)
      current_char.start_activity(@activity)
      redirect_to activity_path(@activity)
    else
      flash[:alert] = "You can't do that. Make sure you have the items and meet the requirements."
      redirect_to character_path(current_char)
    end
  end
end