From edecba859900638646a2ac6d1ce47230c3323de3 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sat, 5 Jun 2021 21:25:36 -0400 Subject: Display costs and requirements for selected activity in select fields via Stimulus + fetch --- app/controllers/application_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/controllers/application_controller.rb') 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 -- cgit v1.2.3