From 5afdcd12f04102b5cf5d5a310981bc576a992119 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 19 May 2021 21:16:15 -0400 Subject: Implement crafting from the hearth forge --- app/views/characters/hearth/index.html.erb | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'app/views/characters') diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index 487bd46..6f2c444 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -8,8 +8,13 @@ @@ -17,14 +22,23 @@ <% current_char.hearth.built_hearth_amenities.each do |bhi| %>

<%= bhi.hearth_amenity.name %>

-

Level <%= bhi.level %>

-

<%= bhi.hearth_amenity.description %>

+

Level <%= bhi.level %>

+

<%= bhi.hearth_amenity.description %>

+ <% if bhi.hearth_amenity.gid == "forge" %> + <%= form_with url: start_activity_path, method: :post do |f| %> + <%= f.select :id, @forge_activities.map { |a| [a.name, a.id] } %> + <%= f.submit "Go" %> + <% end %> + <% end %>
<% end %> <% else %>

You haven't built your hearth yet. First, you'll need to start with a foundation.

<% construct_activity = foundation.construct_activity(1) %> - <%= link_to construct_activity.name, start_activity_path(construct_activity), method: :post %> + <%= form_with url: start_activity_path do |f| %> + <%= f.hidden_field :id, value: construct_activity.id %> + <%= f.submit construct_activity.name %> + <% end %> (costs <%= construct_activity.cost_string %>) <% end %> -- cgit v1.2.3