Redesign put in work #33

Merged
bilal.catic merged 2 commits from redesign-put-in-work into master 2020-10-12 00:30:03 +02:00
Showing only changes of commit 2ad88ea336 - Show all commits

View File

@@ -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