Class: Tasks::CollectionObjects::BrowseController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::CollectionObjects::BrowseController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/collection_objects/browse_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET.
- #set_collection_object ⇒ Object protected
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
GET
7 8 9 |
# File 'app/controllers/tasks/collection_objects/browse_controller.rb', line 7 def index @data = ::Catalog::CollectionObject.data_for(@collection_object) end |
#set_collection_object ⇒ Object (protected)
13 14 15 16 17 18 |
# File 'app/controllers/tasks/collection_objects/browse_controller.rb', line 13 def set_collection_object id = params[:collection_object_id] id ||= CollectionObject.with_project_id(sessions_current_project_id).limit(1).pluck(:id)[0] redirect_to new_collection_object_path, notice: 'Create a collection object first.' and return if id.nil? @collection_object = CollectionObject.with_project_id(sessions_current_project_id).preload(:identifiers, :collecting_event, depictions: [:image], taxon_determinations: [:determiners]).find(id) end |