module LeafletHelper def marker_for(resource, options = {}) coords = [resource.latitude, resource.longitude] "L.marker(#{coords}, #{options}).bindPopup(%s)" % popup_for(resource) end def popup_for(resource) render partial: 'resource/popup', locals: { resource: resource } end end