% model = options[:model] form = options[:form] name = options[:name] type = options[:type]||:text_field group_class_list = [ 'form-group', options[:group_class] ] label_class_list = [ 'control-label', options[:label_class] ] field_class_list = [ 'input-group', options[:field_class] ] input_class_list = [ 'form-control', options[:input_class] ] error_class_list = [ 'text-danger', options[:error_class] ] group_class_list << 'has-error' if model.errors[name].present? group_class = group_class_list.flatten.join ' ' label_class = label_class_list.flatten.join ' ' field_class = field_class_list.flatten.join ' ' input_class = input_class_list.flatten.join ' ' error_class = error_class_list.flatten.join ' ' group_data = options[:group_data] field_data = options[:field_data] input_data = options[:input_data] input_prefix = options[:input_prefix] input_suffix = options[:input_suffix] label_text = options[:label_text] label_prefix = options[:label_prefix] label_suffix = options[:label_suffix] input_options = { disabled: options[:disabled], class: input_class_list, placeholder: options[:placeholder], readonly: options[:readonly], maxlength: options[:maxlength], required: options[:required], data: input_data } input_options[:input_accept] = options[:input_accept] if options[:input_accept].present? input_options[:rows] = options[:rows] if options[:rows].present? error_hidden = options[:error_hidden] %>
<%= model.errors[name].first %>
<% end %>