From 2c2de801b4481695f3d1b6b14527116092cb1197 Mon Sep 17 00:00:00 2001 From: David Gay Date: Thu, 27 May 2021 18:26:25 -0400 Subject: ItemsController that displays item game data --- app/views/items/index.html.erb | 8 ++++++++ app/views/items/show.html.erb | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/views/items/index.html.erb create mode 100644 app/views/items/show.html.erb (limited to 'app/views/items') 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 @@ +

Items

+ +<% @items.each do |item| %> +
+
<%= link_to item.name, item_path(item) %>
+

<%= item.description %>

+
+<% 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 @@ +

<%= @item.name %>

+

<%= @item.description %>

+ +
+

Game Data

+

GID: <%= @item.gid %>

+ <% if @item.whatnot %> +
<%= JSON.pretty_generate(@item.whatnot) %>
+ <% else %> +

Item has no additional data.

+ <% end %> +
-- cgit v1.2.3