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
|
@user = current_user
|
||||||
|
|
||||||
if params[:initem] != ""
|
@addtomap = false
|
||||||
@item = Item.find(params[:initem])
|
|
||||||
|
if params[:initem]
|
||||||
|
if params[:initem] != ""
|
||||||
|
@addtomap = true
|
||||||
|
@itemid = params[:initem]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if @addtomap
|
||||||
|
@item = Item.find(@itemid)
|
||||||
else
|
else
|
||||||
@item = Item.new()
|
@item = Item.new()
|
||||||
@item.name = params[:item][:name]
|
@item.name = params[:item][:name]
|
||||||
|
|
Loading…
Reference in a new issue