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

- (Object) index

GET



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

def index
end

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



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

- (Object) recent_otus

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(range_limit(params[:limit]))
  render '/otus/index'
end

- (Object) recent_topics

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(range_limit(params[:limit])).order(:name)
  render '/controlled_vocabulary_terms/index'
end