show specific homie details
This commit is contained in:
@@ -1,10 +1,21 @@
|
|||||||
class HomiesController < ApplicationController
|
class HomiesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
homies = Homie.where(gang: params[:gang_id]).order(importance: :desc, name: :asc)
|
homies = Homie.where(gang: params[:gang_id]).order(importance: :desc, name: :asc)
|
||||||
# json_response(Homie.all.order(importance: :desc, name: :asc))
|
|
||||||
json_response homies
|
json_response homies
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
homie = Homie.find(params[:homie_id])
|
||||||
|
if homie
|
||||||
|
json_response homie
|
||||||
|
else
|
||||||
|
error_response :bad_request
|
||||||
|
end
|
||||||
|
|
||||||
|
rescue StandardError
|
||||||
|
error_response :bad_request
|
||||||
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
homie = Homie.new(homie_params)
|
homie = Homie.new(homie_params)
|
||||||
if homie.save
|
if homie.save
|
||||||
|
|||||||
Reference in New Issue
Block a user