Sha256: a28ef01ce24eb98fb39a667258c084aec0265e5b5b10733e536c6e9699715f03
Contents?: true
Size: 952 Bytes
Versions: 16
Compression:
Stored size: 952 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals # This helper include some methods for rendering proposals dynamic maps. module MapHelper include Decidim::ApplicationHelper # Serialize a collection of geocoded proposals to be used by the dynamic map component # # geocoded_proposals - A collection of geocoded proposals def proposals_data_for_map(geocoded_proposals) geocoded_proposals.map do |proposal| proposal.slice(:latitude, :longitude, :address).merge(title: present(proposal).title, body: truncate(present(proposal).body, length: 100), icon: icon("proposals", width: 40, height: 70, remove_icon_class: true), link: proposal_path(proposal)) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems