def search_field(field, operator, attributes = {}) field_op = "#{field}_#{operator}" value = (params[:q][field_op] if params[:q]) title = t(".#{field_op}") label_tag = content_tag :label, title attributes[:name] = "q[#{field_op}]" attributes[:type] ||= 'text' attributes[:value] = value input_tag = content_tag :input, nil, attributes [label_tag, input_tag].join.html_safe end