Sha256: 0839e836444f4b56f4d7e8d9f0c2b6014f21663aa740dec9ce2f98144d87508b
Contents?: true
Size: 585 Bytes
Versions: 72
Compression:
Stored size: 585 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # Exposes the initiative type text search so users can choose a type writing its name. class InitiativeTypesController < Decidim::Initiatives::ApplicationController # GET /initiative_types/search def search enforce_permission_to :search, :initiative_type types = FreetextInitiativeTypes.for(current_organization, I18n.locale, params[:term]) render json: { results: types.map { |type| { id: type.id.to_s, text: type.title[I18n.locale.to_s] } } } end end end end
Version data entries
72 entries across 72 versions & 1 rubygems