Class: Tasks::Nomenclature::BySourceController

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

Instance Method Summary (collapse)

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

- (Object) index



4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/tasks/nomenclature/by_source_controller.rb', line 4

def index

  if !ProjectSource.where(project_id: sessions_current_project_id).any? 
    flash[:notice] = 'Create or add a source to your project first.'
    redirect_to sources_path and return
  end 

  @source = Source.find(params[:id]) if !params[:id].blank?
  @source ||= Project.find(sessions_current_project_id).project_sources.first.source
end