Class: LanguagesController

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

Instance Method Summary collapse

Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration

#annotator_params

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form

Methods included from Api::Intercept

#intercept_api

Instance Method Details

#autocompleteObject



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_optionsObject

GET /languages/select_options?klass=source|serial



11
12
13
# File 'app/controllers/languages_controller.rb', line 11

def select_options
  @languages = Language.select_optimized(sessions_current_user_id, sessions_current_project_id, params.require(:klass))
end

#set_languageObject (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

#showObject

GET /languages/12.json



7
8
# File 'app/controllers/languages_controller.rb', line 7

def show
end