NTUE localtion categories as json for Android App
This commit is contained in:
1 parent
8aa1e2dae0
commit
ec6ef5a871
3 files changed
+17
-1
No files matched your search
+11
@@ -33,4 +33,15 @@ class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendContr
|
||||
render :json=>{"success"=>"true"}.to_json
|
||||
end
|
||||
|
||||
def get_location_categories
|
||||
location_categories = LocationCategory.all
|
||||
@data = Array.new
|
||||
|
||||
location_categories.each do |category|
|
||||
@data << { name: category.name }
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate({location_category: @data})
|
||||
end
|
||||
|
||||
end
|
||||
+3
-1
@@ -6,7 +6,9 @@ Rails.application.routes.draw do
|
||||
match "locations/get_locations" => "locations#get_locations"
|
||||
|
||||
resources :locations
|
||||
resources :location_categories
|
||||
resources :location_categories, :except => [:show]
|
||||
match "location_categories/get_location_categories" => "location_categories#get_location_categories"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user