Class: ObservationMatrixRowsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ObservationMatrixRowsController
- Defined in:
- app/controllers/observation_matrix_rows_controller.rb
Instance Method Summary collapse
- #autocomplete ⇒ Object
- #filter_params ⇒ Object private
-
#index ⇒ Object
GET /observation_matrix_rows.json.
- #list ⇒ Object
- #set_matrix_row ⇒ Object private
-
#show ⇒ Object
GET /observation_matrix_rows/1 GET /observation_matrix_rows/1.json.
- #sort ⇒ Object
Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration
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
#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form
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
#autocomplete ⇒ Object
48 49 50 51 52 53 54 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 48 def autocomplete @observation_matrix_rows = Queries::ObservationMatrixRow::Autocomplete.new( params.require(:term), project_id: sessions_current_project_id, observation_matrix_id: params[:observation_matrix_id] ).autocomplete end |
#filter_params ⇒ Object (private)
62 63 64 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 62 def filter_params params.permit(:observation_matrix_id, :collection_object_id, :otu_id) end |
#index ⇒ Object
GET /observation_matrix_rows.json
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# 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 if params[:otu_ids].blank? format.json { @observation_matrix_rows = ObservationMatrixRow.where(filter_params) .where(project_id: sessions_current_project_id) .order('observation_matrix_rows.position') .page(params[:page]).per(params[:per]) } else format.json { @observation_matrix_rows = ObservationMatrixRow .with_otu_ids(params[:otu_ids]).where(filter_params) .where(project_id: sessions_current_project_id) .order('observation_matrix_rows.position') .page(params[:page]).per(params[:per]) } end end end |
#list ⇒ Object
38 39 40 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 38 def list @observation_matrix_rows = ObservationMatrixRow.where(project_id: sessions_current_project_id).page(params[:page]) end |
#set_matrix_row ⇒ Object (private)
58 59 60 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 58 def set_matrix_row @observation_matrix_row = ObservationMatrixRow.where(project_id: sessions_current_project_id).find(params[:id]) end |
#show ⇒ Object
GET /observation_matrix_rows/1 GET /observation_matrix_rows/1.json
35 36 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 35 def show end |
#sort ⇒ Object
43 44 45 46 |
# File 'app/controllers/observation_matrix_rows_controller.rb', line 43 def sort ObservationMatrixRow.sort(params.require(:ids)) head :no_content end |