From 045867220ea68b912f74b74a1476ac08bd19dbfd Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 19 May 2021 19:04:13 -0400 Subject: More work on getting amenity construction working --- app/views/activities/_results.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/views/activities/_results.html.erb') diff --git a/app/views/activities/_results.html.erb b/app/views/activities/_results.html.erb index ba2abe7..42f22a3 100644 --- a/app/views/activities/_results.html.erb +++ b/app/views/activities/_results.html.erb @@ -1,11 +1,16 @@
<% results.each do |result| %> - <% if result[:type] == "item" %> + <% case result[:type] %> + <% when "item" %>

You got <%= result[:quantity] %> <%= result[:item].name %> <% if result[:xp].any? %> (<%= result[:xp].map { |award| "#{award[:amount]} xp #{award[:skill].name}" }.join(", ") %>) <% end %>

+ <% when "hearth_amenity" %> +

You constructed <%= result[:hearth_amenity].name %>.

+ <% when "error" %> +

<%= result[:message] %>

<% end %> <% end %>
-- cgit v1.2.3