Skip to content

Commit

Permalink
Bugfix: Mention missing :category from house_params method
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Aug 13, 2023
1 parent f055174 commit 08c7cce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/controllers/houses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def own

# POST /houses/1 or /houses/1.json
def show
if @house
render json: @house
else
render json: nil, status: :unauthorized
end
end

# POST /houses or /houses.json
Expand Down Expand Up @@ -52,7 +57,7 @@ def set_house
end

def house_params
params.require(:house).permit(:title, :description, :address, :image,
params.require(:house).permit(:title, :description, :category, :address, :image,
:price, :bedroom, :bathroom, :car)
end
end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

get '/houses/own', to: 'houses#own'
resources :houses

devise_for :users, controllers: {
sessions: 'sessions',
registrations: 'registrations'
Expand Down

0 comments on commit 08c7cce

Please sign in to comment.