Unit rebase as a separate action

This commit is contained in:
2024-04-02 22:16:27 +02:00
parent 05b0c66216
commit 1966c782bc
6 changed files with 28 additions and 6 deletions

View File

@@ -56,7 +56,7 @@ module ApplicationHelper
end
def tabular_fields_for(record_name, record_object = nil, options = {}, &block)
flash.now[:alert] = record_name.errors.full_messages unless record_name.errors.empty?
render_errors(record_name)
fields_for(record_name, record_object, **options, &block)
end
@@ -94,6 +94,10 @@ module ApplicationHelper
image_element_to(:link, name, image, options, html_options)
end
def render_errors(record)
flash.now[:alert] = record.errors.full_messages unless record.errors.empty?
end
def render_flash_messages
flash.map do |entry, messages|
Array(messages).map do |message|