tabletop-companion/app/helpers/application_helper.rb

12 lines
269 B
Ruby
Raw Normal View History

2024-05-26 10:45:10 +00:00
# frozen_string_literal: true
2024-04-13 10:22:40 +00:00
module ApplicationHelper
2024-05-29 07:46:31 +00:00
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
2024-04-13 10:22:40 +00:00
end