diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/activities_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index 2f9e9a5..d4ecc65 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -11,4 +11,9 @@ class ActivitiesController < ApplicationController @activity = Activity.find(params[:id]) start_activity(@activity) end + + def costs_and_requirements + @activity = Activity.find(params[:id]) + render partial: "activities/costs_and_requirements" + end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fc38d15..607fe6e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -21,10 +21,8 @@ class ApplicationController < ActionController::Base if current_char.start_activity(activity, queued_actions: queued_actions) redirect_to character_path(current_char) else - message = "You can't do that." - message += " (requires #{activity.requirements&.join(", ")})" if activity.requirements.any? - message += " (costs #{activity.costs&.join(", ")})" if activity.costs.any? - flash[:alert] = message + message = "You can't do that. Check the costs and requirements." + flash[:alert] = message.strip redirect_back(fallback_location: character_path(current_char)) end end |