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

#polymorphic_filter_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

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) filter_params (private)



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

def filter_params
  params.permit(:matrix_id)
end

- (Object) index

GET /matrices GET /matrices.json



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

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).with_project_id(sessions_current_project_id)
    }
  end
end

- (Object) list



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

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

- (Object) set_matrix_row (private)

Use callbacks to share common setup or constraints between actions.



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

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

- (Object) show

GET /matrix_rows/1 GET /matrix_rows/1.json



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

def show
end