module ActionView::Helpers::FormHelper
Public Instance Methods
error_for(object_name, attribute, **options)
click to toggle source
# File lib/optimism.rb, line 94 def error_for(object_name, attribute, **options) tag.span **options.merge(id: error_id_for(object_name, attribute)) end
error_id_for(object_name, attribute)
click to toggle source
# File lib/optimism.rb, line 98 def error_id_for(object_name, attribute) Optimism.error_selector.sub("RESOURCE", object_name.to_s.delete("]").tr("[", "_")).sub("ATTRIBUTE", attribute.to_s)[1..-1] end