Class: Decidim::ResourceAutocompleteController

Inherits:
ApplicationController show all
Defined in:
decidim-core/app/controllers/decidim/resource_autocomplete_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#store_share_token

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from TranslatableAttributes

#attachment?, #default_locale?

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
# File 'decidim-core/app/controllers/decidim/resource_autocomplete_controller.rb', line 5

def index
  respond_to do |format|
    format.json do
      if term.blank?
        render json: [{ title: t("decidim.resource_autocomplete.help"), help: true }]
      else
        render json: serialized_results
      end
    end
  end
end