You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

7 lines
341 B

<%-
error_attr = attr.to_s.sub(/price_str$/, 'price_minor')
error_attr = f.object.has_attribute?(error_attr) ? error_attr : attr
-%>
<%= f.text_field attr,
class: f.object.errors.include?(error_attr) ? 'field_with_errors' : nil,
title: f.object.errors.full_messages_for(error_attr).uniq.join("\n") %>