Class: Tasks::Otus::BrowseController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Otus::BrowseController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/otus/browse_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET.
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
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 |