From b6aeac4d9274f17e748efb3715aa08f4b7c361f2 Mon Sep 17 00:00:00 2001 From: hellekin Date: Wed, 11 Nov 2020 22:27:18 +0100 Subject: Add map support This commit creates a dedicated Map model and moves the JavaScript from view to a Stimulus controller. - Stimulus.js https://stimulusjs.org - Leaflet.js https://leafletjs.org Upcoming resources: - https://discourse.stimulusjs.org/t/leafletjs-with-stimulusjs-on-rails-6/1343/4 - https://github.com/ghybs/leaflet-defaulticon-compatibility --- app/controllers/welcome_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controllers') diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 0c41e5a..ee76eb6 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,6 +1,7 @@ class WelcomeController < ApplicationController # GET / def index + @map = Map.first @resources = Resource.order(:uuid).page params[:page] Rails.logger.info "WECLOME ///// #{@resources&.count || 0}" end -- cgit v1.2.3