NTUE localtion categories as json for Android App
This commit is contained in:
parent
8aa1e2dae0
commit
ec6ef5a871
|
@ -5,6 +5,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
|||
def show
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@tags = Tag.find(@album.tagged_ids).map{|t| t.name}
|
||||
respond_to do |format|
|
||||
format.json { render json: @album }
|
||||
end
|
||||
end
|
||||
|
||||
def get_albums
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue