Class: ObservationMatrixColumnsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ObservationMatrixColumnsController
- Defined in:
- app/controllers/observation_matrix_columns_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
- #filter_params ⇒ Object private
-
#index ⇒ Object
GET /matrix_columns GET /matrix_columns.json.
- #list ⇒ Object
- #set_observation_matrix_column ⇒ Object private
-
#show ⇒ Object
GET /matrix_columns/1 GET /matrix_columns/1.json.
- #sort ⇒ Object
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
#filter_params ⇒ Object (private)
41 42 43 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 41 def filter_params params.permit(:descriptor_id, :observation_matrix_id) end |
#index ⇒ Object
GET /matrix_columns GET /matrix_columns.json
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 9 def index respond_to do |format| format.html do @recent_objects = ObservationMatrixColumn.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10) render '/shared/data/all/index' end format.json { @observation_matrix_columns = ObservationMatrixColumn.where(filter_params) .where(project_id: sessions_current_project_id) .order('observation_matrix_columns.position') .page(params[:page]).per(params[:per]) } end end |
#list ⇒ Object
29 30 31 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 29 def list @observation_matrix_columns = ObservationMatrixColumn.with_project_id(sessions_current_project_id).page(params[:page]) end |
#set_observation_matrix_column ⇒ Object (private)
45 46 47 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 45 def set_observation_matrix_column @observation_matrix_column = ObservationMatrixColumn.where(project_id: sessions_current_project_id).find(params[:id]) end |
#show ⇒ Object
GET /matrix_columns/1 GET /matrix_columns/1.json
26 27 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 26 def show end |
#sort ⇒ Object
34 35 36 37 |
# File 'app/controllers/observation_matrix_columns_controller.rb', line 34 def sort ObservationMatrixColumn.sort(params.require(:ids)) head :no_content end |