Class: LanguagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- LanguagesController
- Defined in:
- app/controllers/languages_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
- #autocomplete ⇒ Object
-
#select_options ⇒ Object
GET /languages/select_options?klass=source|serial.
- #set_language ⇒ Object protected
-
#show ⇒ Object
GET /languages/12.json.
Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#autocomplete ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/languages_controller.rb', line 15 def autocomplete languages = Language.find_for_autocomplete(params) data = languages.collect do |t| str = t.english_name {id: t.id, label: str, response_values: { params[:method] => t.id}, label_html: str } end render json: data end |
#select_options ⇒ Object
GET /languages/select_options?klass=source|serial
11 12 13 |
# File 'app/controllers/languages_controller.rb', line 11 def @languages = Language.select_optimized(sessions_current_user_id, sessions_current_project_id, params.require(:klass)) end |
#set_language ⇒ Object (protected)
33 34 35 36 |
# File 'app/controllers/languages_controller.rb', line 33 def set_language @language = Language.find(params.require(:id)) @recent_object = @language end |
#show ⇒ Object
GET /languages/12.json
7 8 |
# File 'app/controllers/languages_controller.rb', line 7 def show end |