diff options
author | David Gay <david@davidgay.org> | 2021-07-14 18:51:48 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-14 18:52:30 -0400 |
commit | 8159ff22e530d30bad99952894bc9392cd287248 (patch) | |
tree | b62508512305bd6902a933089cfd072e4831a074 /app/views | |
parent | f039c9401b1e9417e18472c35bea39cb659d2f45 (diff) |
Display activity-select (description, costs, and requirements) on hearth plantings view
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/characters/hearth/hearth_plantings/index.html.erb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/views/characters/hearth/hearth_plantings/index.html.erb b/app/views/characters/hearth/hearth_plantings/index.html.erb index d8e7f96..3f6964f 100644 --- a/app/views/characters/hearth/hearth_plantings/index.html.erb +++ b/app/views/characters/hearth/hearth_plantings/index.html.erb @@ -3,11 +3,15 @@ <p>You have <span class="font-bold"><%= @hearth.available_planting_spots %></span> available planting spots.</p> <div class="my-4"> - <%= form_with url: start_activity_path, method: :post do |f| %> - <%= f.select :id, @planting_activities.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 "Plant" %> - <% end %> + <div data-controller="activity-select"> + <%= form_with url: start_activity_path, method: :post do |f| %> + <%= f.select :id, @planting_activities.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 "Plant" %> + <% end %> + <div data-activity-select-target="output" class="my-1"></div> + </div> </div> <div class="grid grid-cols-1 lg:grid-cols-2 gap-4"> |