Loamspire

You have <%= @hearth.available_planting_spots %> available planting spots.

<%= 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 %>
<% @hearth_plantings.sort_by(&:ripens_at).each do |hp| %>

<%= hp.item.name %>

<% if hp.ripens_at > Time.now %>

Ripens in <%= distance_of_time_in_words_to_now(hp.ripens_at) %>

<% else %> <% harvest_activity = Activity.find_by_gid(hp.item.whatnot[:harvest_activity]) %> <%= form_with url: start_activity_path(harvest_activity) do |f| %> <%= f.hidden_field :id, value: harvest_activity.id %> <%= f.hidden_field :actions, value: current_char.hearth.ripe_hearth_plantings_of(hp.item).count %> <%= f.submit "Harvest" %> <% end %> <% end %>
<% end %>