5.5-6 implemented clickable links to places

This commit is contained in:
Aaro Koivukangas
2023-11-16 15:54:22 +02:00
parent 727b95dd00
commit ae90d47254
4 changed files with 26 additions and 3 deletions
+6
View File
@@ -7,7 +7,13 @@ class PlacesController < ApplicationController
if @places.empty?
redirect_to places_path, notice: "No locations in #{params[:city]}"
else
session[:last_city_search] = params[:city]
render :index, status: 418
end
end
def show
places = BeermappingApi.places_in(session[:last_city_search])
@place = places.select { |place| place.id == params[:id]}[0]
end
end