tabletop-companion/app/helpers/application_helper.rb

12 lines
269 B
Ruby

# frozen_string_literal: true
module ApplicationHelper
def display_form_errors(object, attr)
return unless object.errors.include?(attr)
content_tag(:div, class: "invalid-feedback") do
object.errors.full_messages_for(attr).join(". ")
end
end
end