module FormsHelper
  # rubocop:disable Metrics/MethodLength
  def breadcrumbs
    content_tag(:ol, class: 'breadcrumb') do
      wizard_steps.collect do |every_step|
        class_str =
          if every_step == step
            "active"
          elsif past_step?(every_step)
            "past"
          else
            "future"
          end

        concat(
          content_tag(:li, class: class_str) do
            link_to I18n.t(every_step), wizard_path(every_step)
          end
        )
      end
    end
  end
end

module FormsHelper
  # rubocop:disable Metrics/MethodLength
  def breadcrumbs
    content_tag(:ol, class: 'breadcrumb') do
      wizard_steps.collect do |every_step|
        concat(
          content_tag(:li, class: breadcrumb_class(every_step)) do
            breadcrumb(every_step)
          end
        )
      end
    end
  end

  def breadcrumb(every_step)
    if step == every_step
      I18n.t(every_step)
    else
      link_to I18n.t(every_step), wizard_path(every_step)
    end
  end

  def breadcrumb_class(every_step)
    if every_step == step
      "active"
    elsif past_step?(every_step)
      "past"
    else
      "future"
    end
  end
end

Fix breadcrumbs to indicate which one we're on
Fix breadcrumbs to indicate which one we're on
