updated json format for location and locaiton categories
This commit is contained in:
parent
44f5a98a69
commit
fea0540ec3
|
@ -43,10 +43,10 @@ class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendContr
|
|||
I18n.locale = :zh_tw
|
||||
name_zh_tw = category.name
|
||||
category_id = category.id.to_s
|
||||
@data << { name_en: name_en, name_zh_tw: name_zh_tw, category_id: category_id, location_link: "http://ntue.tp.rulingcom.com/panel/location/back_end/locations/get_categorywise_locations?category_id[]=#{category_id}"}
|
||||
@data << { name_en: name_en, name_zh_tw: name_zh_tw, category_id: category_id, location_link: "http://ntue.tp.rulingcom.com/panel/location/back_end/locations/get_categorywise_locations?category_id=#{category_id}"}
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate({location_category: @data})
|
||||
render :json => JSON.pretty_generate(@data)
|
||||
end
|
||||
|
||||
end
|
|
@ -75,8 +75,7 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||
end
|
||||
|
||||
def get_categorywise_locations
|
||||
@category_id = params[:category_id].first
|
||||
location_infos = LocationInfo.where(:location_category_id => @category_id)
|
||||
location_infos = LocationInfo.where(:location_category_id => params[:category_id])
|
||||
@data = Array.new
|
||||
|
||||
location_infos.each do |location|
|
||||
|
@ -92,6 +91,6 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||
description: location.description }
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate({location: @data})
|
||||
render :json => JSON.pretty_generate(@data)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue