Class: ObservationMatrixRowsController

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

#annotator_params

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, #whitelist_constantize

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) filter_params (private)



40
41
42
# File 'app/controllers/observation_matrix_rows_controller.rb', line 40

def filter_params
  params.permit(:observation_matrix_id, :collection_object_id, :otu_id)
end

- (Object) index

GET /observation_matrix_rows.json



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

def index
  respond_to do |format|
    format.html do
      @recent_objects = ObservationMatrixRow.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
      render '/shared/data/all/index'
    end
    format.json {
      @observation_matrix_rows = ObservationMatrixRow.where(filter_params).where(project_id: sessions_current_project_id)
    }
  end
end

- (Object) list



24
25
26
# File 'app/controllers/observation_matrix_rows_controller.rb', line 24

def list
  @observation_matrix_rows = ObservationMatrixRow.where(project_id: sessions_current_project_id).page(params[:page])
end

- (Object) set_matrix_row (private)



36
37
38
# File 'app/controllers/observation_matrix_rows_controller.rb', line 36

def set_matrix_row
  @observation_matrix_row = ObservationMatrixRow.where(project_id: sessions_current_project_id).find(params[:id])
end

- (Object) show

GET /observation_matrix_rows/1 GET /observation_matrix_rows/1.json



21
22
# File 'app/controllers/observation_matrix_rows_controller.rb', line 21

def show
end

- (Object) sort



29
30
31
32
# File 'app/controllers/observation_matrix_rows_controller.rb', line 29

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