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/views/characters/hearth/index.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'app/views/characters/hearth') diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index ee5b07d..1ad2726 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -15,11 +15,15 @@

Level <%= built_amenity.level %>

<%= ha.description %>

<% if @amenity_activities[ha.gid.to_sym] %> - <%= form_with url: start_activity_path, method: :post do |f| %> - <%= f.select :id, @amenity_activities[ha.gid.to_sym].sort_by { |a| a.name }.map { |a| [a.name, a.id] } %> - <%= f.number_field :actions, value: 1, size: 5, min: 1, max: 2_000_000_000 %> - <%= f.submit "Go" %> - <% end %> +
+ <%= form_with url: start_activity_path, method: :post do |f| %> + <%= f.select :id, @amenity_activities[ha.gid.to_sym].sort_by { |a| a.name }.map { |a| [a.name, a.id] }, + {}, { data: { activity_select_target: "select", action: "activity-select#load" } } %> + <%= f.number_field :actions, value: 1, size: 5, min: 1, max: 2_000_000_000 %> + <%= f.submit "Go" %> + <% end %> +
+
<% end %> <% if built_amenity.usable? %> <% if built_amenity.on_cooldown? %> -- cgit v1.2.3