Module: Course::LessonPlan::TodosHelper

Included in:
ControllerHelper
Defined in:
app/helpers/course/lesson_plan/todos_helper.rb

Instance Method Summary collapse

Instance Method Details

#todo_status_class(todo) ⇒ Array<String>

A helper to add a CSS class for each todo, based on the workflow state.

Parameters:

Returns:

  • (Array<String>)

    CSS class to be added to the todo tag.


7
8
9
10
11
12
13
# File 'app/helpers/course/lesson_plan/todos_helper.rb', line 7

def todo_status_class(todo)
  if todo.item.end_at && todo.item.end_at < Time.zone.now
    ['danger']
  else
    []
  end
end