Class: Tasks::CollectionObjects::BrowseController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/collection_objects/browse_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#indexObject

GET



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/tasks/collection_objects/browse_controller.rb', line 5

def index
  q = CollectionObject.where(project_id: sessions_current_project_id)
  if id = params[:collection_object_id]
    @collection_object = q.find(id)
  elsif id = q.limit(1).pluck(:id).first
    redirect_to browse_collection_objects_task_path(collection_object_id: id) and return
  else
    redirect_to new_collection_object_path, notice: 'Create a collection object first.' and return
  end
end