Render dynamically vertical tabs and set classes depends on if statement
Helper methods are good for this.  In your view's helper file:

def task_link_class(task)
  if @current_user_tasks.include?(task)
    ''
  else
    'inactive'
  end
end


Some would prefer the trinary operator instead:

def task_link_class(task)
  @current_user_tasks.include?(task) ? '' : 'inactive'
end


And in your view:

= link_to task.name, "#tab#{task.id}", data: { toggle: 'tab' }, class: task_link_class(task)