Class: ObservationMatrixColumnsController

Inherits:
ApplicationController show all
Includes:
DataControllerConfiguration::ProjectDataControllerConfiguration
Defined in:
app/controllers/observation_matrix_columns_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

- (Object) filter_params (private)



37
38
39
# File 'app/controllers/observation_matrix_columns_controller.rb', line 37

def filter_params
  params.permit(:descriptor_id, :observation_matrix_id)
end

- (Object) index

GET /matrix_columns GET /matrix_columns.json



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/observation_matrix_columns_controller.rb', line 8

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')
    }
  end
end

- (Object) list



25
26
27
# File 'app/controllers/observation_matrix_columns_controller.rb', line 25

def list
  @observation_matrix_columns = ObservationMatrixColumn.with_project_id(sessions_current_project_id).page(params[:page])
end

- (Object) set_observation_matrix_column (private)



41
42
43
# File 'app/controllers/observation_matrix_columns_controller.rb', line 41

def set_observation_matrix_column
  @observation_matrix_column = ObservationMatrixColumn.find(params[:id])
end

- (Object) show

GET /matrix_columns/1 GET /matrix_columns/1.json



22
23
# File 'app/controllers/observation_matrix_columns_controller.rb', line 22

def show
end

- (Object) sort



30
31
32
33
# File 'app/controllers/observation_matrix_columns_controller.rb', line 30

def sort
  ObservationMatrixColumn.sort(params.require(:ids))
  head :no_content 
end