From 1b2de86007508ba86c6c9cb99fbdcac178045131 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 2 May 2021 22:38:32 -0400 Subject: Character items and inventory, with ability to add and remove items --- app/views/application/_navbar.html.erb | 11 ++++------ app/views/characters/items/index.html.erb | 36 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 app/views/characters/items/index.html.erb (limited to 'app/views') diff --git a/app/views/application/_navbar.html.erb b/app/views/application/_navbar.html.erb index 5d3a2cb..85f4642 100644 --- a/app/views/application/_navbar.html.erb +++ b/app/views/application/_navbar.html.erb @@ -1,16 +1,13 @@ diff --git a/app/views/characters/items/index.html.erb b/app/views/characters/items/index.html.erb new file mode 100644 index 0000000..e313f7e --- /dev/null +++ b/app/views/characters/items/index.html.erb @@ -0,0 +1,36 @@ +

Inventory

+ + + + + + + + + + + + + <% @character_items.ordered_by_item_name.each do |ci| %> + + + + + + + + <% end %> + +
AmountItemEquipUseDestroy
<%= ci.quantity %><%= ci.item.name %> + <% if ci.item.equip_slot %> + <%= link_to "[Equip]", "#" %> + <% end %> + + <% if ci.item.usable? %> + <%= link_to "[Use]", "#" %> + <% end %> + + <%= link_to "[Destroy]", "#" %> + <%= link_to "[Destroy All]", "#" %> +
+ -- cgit v1.2.3