Created
October 16, 2014 06:46
-
-
Save kennethgeerts/16ac061c201d1edb7b74 to your computer and use it in GitHub Desktop.
Revisions
-
Kenneth Geerts created this gist
Oct 16, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ 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