diff options
author | David Gay <david@davidgay.org> | 2021-05-27 18:26:25 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-27 18:26:25 -0400 |
commit | 2c2de801b4481695f3d1b6b14527116092cb1197 (patch) | |
tree | 63656e5870438ce2b1185b198ff38ce73c5cf78c /app/views/items | |
parent | 82ebb73bb4fc53ec5af428a88809ab8f11e52c0b (diff) |
ItemsController that displays item game data
Diffstat (limited to 'app/views/items')
-rw-r--r-- | app/views/items/index.html.erb | 8 | ||||
-rw-r--r-- | app/views/items/show.html.erb | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/app/views/items/index.html.erb b/app/views/items/index.html.erb new file mode 100644 index 0000000..5d004d3 --- /dev/null +++ b/app/views/items/index.html.erb @@ -0,0 +1,8 @@ +<h1 class="text-3xl mb-4">Items</h1> + +<% @items.each do |item| %> + <div class="my-2"> + <div><%= link_to item.name, item_path(item) %></div> + <p class="italic"><%= item.description %></p> + </div> +<% end %> diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb new file mode 100644 index 0000000..675c518 --- /dev/null +++ b/app/views/items/show.html.erb @@ -0,0 +1,12 @@ +<h1 class="text-3xl mb-2"><%= @item.name %></h1> +<p class="italic"><%= @item.description %></p> + +<div class="my-6"> + <h2 class="text-xl">Game Data</h2> + <p>GID: <span class="text-code"><%= @item.gid %></span></p> + <% if @item.whatnot %> + <div class="text-code my-2"><%= JSON.pretty_generate(@item.whatnot) %></div> + <% else %> + <p>Item has no additional data.</p> + <% end %> +</div> |