22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/helpers/effective_resources_wizard_helper.rb', line 22
def (resource, nav_step, index = nil)
current = (nav_step == step)
title = resource_wizard_step_title(resource, nav_step)
disabled = !resource.can_visit_step?(nav_step)
label = [index, title].compact.join('. ')
klass = ['list-group-item', ('active' if current), ('disabled' if disabled && !current)].compact.join(' ')
if (current || disabled)
content_tag(:li, label, class: klass)
else
link_to(label, wizard_path(nav_step), class: klass)
end
end
|