Class: ConfidenceLevelsController

Inherits:
ApplicationController show all
Includes:
DataControllerConfiguration::ProjectDataControllerConfiguration
Defined in:
app/controllers/confidence_levels_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#is_data_controller, #is_task_controller, #meta_data, #meta_description, #meta_keywords, #meta_title, #page_title, #site_name

Instance Method Summary (collapse)

Methods inherited from ApplicationController

#clear_project_and_user_variables, #digest_cookie, #digested_cookie_exists?, #disable_turbolinks, #intercept_api, #invalid_object, #is_data_controller?, #is_task_controller?, #log_user_recent_route, #notice_user, #project_matches, #record_not_found, #set_project_and_user_variables, #set_project_from_params, #token_authenticate

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) lookup



4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/confidence_levels_controller.rb', line 4

def lookup
  @confidence_levels = Queries::ControlledVocabularyTermAutocompleteQuery.new(term_param, project_id: sessions_current_project_id, object_type: 'ConfidenceLevel').all
  render(:json => @confidence_levels.collect { |t|
    {
        label: t.name,
        object_id: t.id,
        definition: t.definition
    }
  })
end

- (Object) term_param (protected)



17
18
19
# File 'app/controllers/confidence_levels_controller.rb', line 17

def term_param
  params.require(:term)
end