Class: Tasks::Content::EditorController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Content::EditorController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/content/editor_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET.
- #range_limit(param = default, min = 1, max = 30, default = 5) ⇒ Object
-
#recent_otus ⇒ Object
GET .json.
-
#recent_topics ⇒ Object
GET .json.
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
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_otus ⇒ Object
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_topics ⇒ Object
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 |