Class: Tasks::Content::EditorController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#indexObject

GET



5
6
# File 'app/controllers/tasks/content/editor_controller.rb', line 5

def index
end

#range_limit(param = default, min = 1, max = 30, default = 5) ⇒ Object



20
21
22
23
24
25
26
# File 'app/controllers/tasks/content/editor_controller.rb', line 20

def range_limit(param = default,min = 1,max = 30,default = 5)
  if (param.to_i.between? min, max)
    return param
  else
    param = default
  end     
end

#recent_otusObject

GET .json



15
16
17
18
# File 'app/controllers/tasks/content/editor_controller.rb', line 15

def recent_otus
  @otus = Otu.where(project: sessions_current_project).distinct.recently_updated.limit(range_limit(params[:limit]))
  render '/otus/index'
end

#recent_topicsObject

GET .json



9
10
11
12
# File 'app/controllers/tasks/content/editor_controller.rb', line 9

def recent_topics
  @controlled_vocabulary_terms = Topic.where(project: sessions_current_project).distinct.recently_updated.limit(range_limit(params[:limit])).order(:name)
  render '/controlled_vocabulary_terms/index'
end