API login/logout with http header token

This commit is contained in:
Min Zeya Phyo
2017-04-15 12:52:40 +06:30
parent 5ca9615e38
commit 355f4fadb0
11 changed files with 67 additions and 86 deletions

View File

@@ -1,7 +1,16 @@
class Api::Restaurant::ZonesController < Api::ApiController
def index
render json: Zone.includes([:tables, :rooms]).where("is_active = true")
if (params[:filter] && params[:filter] = "all" )
@all_tables = Table.active
@all_rooms = Room.active
else
@zones = Zone.includes([:tables, :rooms]).where("is_active = true")
end
end
private
def zones_params
params.permit(:filter)
end
end