diff --git a/app/controllers/bus_route_infos_controller.rb b/app/controllers/bus_route_infos_controller.rb index 0661e4e..e759257 100644 --- a/app/controllers/bus_route_infos_controller.rb +++ b/app/controllers/bus_route_infos_controller.rb @@ -1,5 +1,10 @@ class BusRouteInfosController < ApplicationController def show @bus_route_info = BusRouteInfo.preload(:bus_stops).find(params[:id]) + @hash = Gmaps4rails.build_markers(@bus_route_info.bus_stops) do |bus_stop, marker| + marker.lat bus_stop.latitude + marker.lng bus_stop.longitude + marker.infowindow bus_stop.name + end end end diff --git a/app/views/bus_route_infos/show.html.erb b/app/views/bus_route_infos/show.html.erb index e0c7c5f..c627109 100644 --- a/app/views/bus_route_infos/show.html.erb +++ b/app/views/bus_route_infos/show.html.erb @@ -5,4 +5,13 @@