Sha256: 39a9bc3e4cda8ed3a05265331107cfe527d8c2077b37e7c3f0c8e3f264e2f138
Contents?: true
Size: 1.41 KB
Versions: 20
Compression:
Stored size: 1.41 KB
Contents
require_relative '../../base' module CCS module Components module GovUK class ErrorSummary < Base # = GOV.UK Error Summary Item # # The individual list item for the error summary # # @!attribute [r] text # @return [String] Text for the error message item # @!attribute [r] href # @return [String] The href for the error message class Item < Base private attr_reader :text, :href public # @param text [String] the text for the error link item # @param href [String] the href for the error link item. # If provided item will be a link # @param options [Hash] options that will be used in customising the HTML # # @option options [Hash] :attributes any additional attributes that will added as part of the HTML. def initialize(text:, href: nil, **options) super(**options) @text = text @href = href end # Generates the HTML for the GOV.UK Error Summary Item # # @return [ActiveSupport::SafeBuffer] def render tag.li do if href link_to(text, href, **options[:attributes]) else text end end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems