fixed add topic bug, wasn't adding topics when on pages other than maps.
This commit is contained in:
parent
c7dfd836f1
commit
69b2fe87cc
1 changed files with 11 additions and 2 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue