lib/lipstick/helpers/form_helper.rb in aaf-lipstick-3.1.0 vs lib/lipstick/helpers/form_helper.rb in aaf-lipstick-3.2.0

- old
+ new

@@ -33,25 +33,28 @@ def inline_form_tag(url_for_options = {}, options = {}) add_css_class(options, 'form-inline') form_tag(url_for_options, options) { yield } end - def search_form_tag(filter, url: nil) + def search_form_tag(filter, url: nil, + placeholder: 'Search within these entries') form_tag(url, method: :get) do - field_block { search_form_input_tag(filter) } + field_block { search_form_input_tag(filter, placeholder) } end end - def search_form_input_tag(filter) + def search_form_input_tag(filter, placeholder) content_tag('div', class: 'row') do - content_tag('div', grouped_search_field(filter), class: 'col-lg-12') + content_tag('div', grouped_search_field( + filter, placeholder + ), class: 'col-lg-12') end end - def search_filter_text_field(filter) + def search_filter_text_field(filter, placeholder) orig_text_field_tag(:filter, filter, - placeholder: 'Search within these entries', + placeholder: placeholder, autocomplete: 'off', class: 'form-control') end def search_button @@ -59,12 +62,12 @@ concat(icon_tag('search')) concat(' Search') end end - def grouped_search_field(filter) + def grouped_search_field(filter, placeholder) content_tag('div', class: 'input-group') do - concat(search_filter_text_field(filter)) + concat(search_filter_text_field(filter, placeholder)) concat(content_tag('span', search_button, class: 'input-group-btn')) end end def hidden_fields(&block)