diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index b21a21f1..9f122669 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -49,11 +49,11 @@ class ItemsController < ApplicationController # GET showcard/:id def showcard - @current = current_user - @item = Item.find(params[:id]).authorize_to_show(@current) + @user = current_user + @item = Item.find(params[:id]).authorize_to_show(@user) respond_to do |format| - format.json { respond_with(@item) } + format.html { respond_with(@item, @user) } end end diff --git a/app/views/items/showcard.html.erb b/app/views/items/showcard.html.erb index a1d0c508..11dfe657 100644 --- a/app/views/items/showcard.html.erb +++ b/app/views/items/showcard.html.erb @@ -8,12 +8,12 @@ class="icon" height="50" width="50" />
- <%= node.name %> + <%= @item.name %>
Added by: - - <%= User.all.find(@item.user_id).name %> + + <%= @user.name %>