summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-05 21:25:36 -0400
committerDavid Gay <david@davidgay.org>2021-06-05 21:25:36 -0400
commitedecba859900638646a2ac6d1ce47230c3323de3 (patch)
treec911250639d416a428403d63b7445dd392ce27de /app/controllers/application_controller.rb
parent3f44addf1959ff095a4eb23fc30c6642fcfdcaf2 (diff)
Display costs and requirements for selected activity in select fields via Stimulus + fetch
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb6
1 files changed, 2 insertions, 4 deletions
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