diff --git a/app/controllers/api/v1/places_controller.rb b/app/controllers/api/v1/places_controller.rb index 25cfabd..6625121 100644 --- a/app/controllers/api/v1/places_controller.rb +++ b/app/controllers/api/v1/places_controller.rb @@ -12,12 +12,17 @@ def show render json: @place end + def new + @place = Place.new + render json: @place + end + # POST /places def create @place = Place.new(place_params) if @place.save - render json: @place, status: :created, location: @place + render json: @place, status: :created else render json: @place.errors, status: :unprocessable_entity end @@ -46,6 +51,6 @@ def set_place # Only allow a list of trusted parameters through. def place_params - params.require(:place).permit(:description, :photo, :location, :rate, :user_id) + params.require(:place).permit(:description, :photo, :location, :rate, :user_id, :address) end end