show specific homie details
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
class HomiesController < ApplicationController
|
||||
def index
|
||||
homies = Homie.where(gang: params[:gang_id]).order(importance: :desc, name: :asc)
|
||||
# json_response(Homie.all.order(importance: :desc, name: :asc))
|
||||
json_response homies
|
||||
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
|
||||
homie = Homie.new(homie_params)
|
||||
if homie.save
|
||||
|
||||
Reference in New Issue
Block a user