demarches-normaliennes/app/components/expandable_error_list.rb

12 lines
219 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class ExpandableErrorList < ApplicationComponent
def initialize(errors:)
@errors = errors
end
def splitted_errors
yield(Array(@errors[0..2]), Array(@errors[3..]))
end
end