From 38f3a39221869483e3468e9f4d8cab5450a70f89 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sat, 22 May 2021 15:39:16 -0400 Subject: Equiping and unequiping items --- app/views/characters/items/index.html.erb | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'app/views/characters') diff --git a/app/views/characters/items/index.html.erb b/app/views/characters/items/index.html.erb index e313f7e..a7c932d 100644 --- a/app/views/characters/items/index.html.erb +++ b/app/views/characters/items/index.html.erb @@ -1,23 +1,49 @@ -

Inventory

+

Inventory

- +

Equipment

+ +
+ + + + + + + + + <% @character.equipment.each do |eq| %> + + + + + + <% end %> + +
SlotItemUnequip
<%= eq.slot.to_s %><%= eq.item.name %> + <%= button_to "Unequip", character_item_unequip_path(slot: eq.slot ) %> +
+ + + +

Inventory

+ + - - <% @character_items.ordered_by_item_name.each do |ci| %> + <% @character.character_items.ordered_by_item_name.each do |ci| %> - <% end %> -- cgit v1.2.3
Amount Item Equip UseDestroy
<%= ci.quantity %> <%= ci.item.name %> - <% if ci.item.equip_slot %> - <%= link_to "[Equip]", "#" %> + <% if ci.item.equipment? %> + <%= button_to "Equip", character_item_equip_path(item_id: ci.item.id) %> <% end %> @@ -25,10 +51,6 @@ <%= link_to "[Use]", "#" %> <% end %> - <%= link_to "[Destroy]", "#" %> - <%= link_to "[Destroy All]", "#" %> -