Sha256: 2f2f27cd297c24fec5eb81c27ed3485798faef8757faf56601b932c1579aa160

Contents?: true

Size: 438 Bytes

Versions: 4

Compression:

Stored size: 438 Bytes

Contents

module DynamicScaffoldHelper
  def render_form_errors(errors)
    return '' if errors.blank?
    tag.ul(class: 'list-unstyled ds-error-message') do
      errors.each do |message|
        concat tag.li("#{dynamic_scaffold_icon :error} #{message}".html_safe) # rubocop:disable Rails/OutputSafety
      end
    end
  end

  def dynamic_scaffold_icon(name)
    instance_exec name, &::Rails.application.config.dynamic_scaffold.icons
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dynamic_scaffold-0.10.0 app/helpers/dynamic_scaffold_helper.rb
dynamic_scaffold-0.9.2 app/helpers/dynamic_scaffold_helper.rb
dynamic_scaffold-0.9.1 app/helpers/dynamic_scaffold_helper.rb
dynamic_scaffold-0.9.0 app/helpers/dynamic_scaffold_helper.rb