From 69b2fe87ccca3057febaebddd742908e7ce98b57 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Wed, 31 Oct 2012 00:25:56 -0400 Subject: [PATCH] fixed add topic bug, wasn't adding topics when on pages other than maps. --- app/controllers/items_controller.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 6b278ad6..fe2f679f 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -46,8 +46,17 @@ class ItemsController < ApplicationController @user = current_user - if params[:initem] != "" - @item = Item.find(params[:initem]) + @addtomap = false + + if params[:initem] + if params[:initem] != "" + @addtomap = true + @itemid = params[:initem] + end + end + + if @addtomap + @item = Item.find(@itemid) else @item = Item.new() @item.name = params[:item][:name]