Class: Tasks::Otus::BrowseController

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

Instance Method Summary (collapse)

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

- (Object) index

GET



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

def index
  if params[:otu_id]
  @otu = Otu.where(project_id: sessions_current_project_id).find(params.require(:otu_id))
  else
    @otu = Otu.where(project_id: sessions_current_project_id).first
  end
  redirect_to new_otu_path, notice: 'No OTUs created, add one first.' and return if @otu.nil? 
end