Sha256: a9d7deb7a935c28fa38878dec36a0f7bafe124c1a82e62be24b3dca5876fbc35
Contents?: true
Size: 560 Bytes
Versions: 4
Compression:
Stored size: 560 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::ApplicationController # GET /initiative_types/search def search authorize! :search, InitiativesType 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
4 entries across 4 versions & 1 rubygems