module FormHelper - FormHelper has no descriptive comment
def form_row opts={}, &block
css_classes = ['form-group']
css_classes.push opts[:class] if opts[:class] - FormHelper#form_row calls 'opts[:class]' 2 times
-
css_classes.push 'error' if opts[:for] && opts[:for][0].errors[opts[:for][1]].any? - FormHelper#form_row calls 'opts[:for]' 3 times
-
content_tag :div, capture(&block), :class => css_classes.join(' ')
end
def countries_for_select - FormHelper#countries_for_select doesn't depend on instance state (maybe move it to another class?)
Location.menu
end
def error_messages_for_field(object, field_name, options = {})
if errors = object && object.errors[field_name].presence
content_tag :span, errors.first, { class: 'error-message' }.merge(options)
end
end
end