ozfortress/citadel

View on GitHub
app/views/application/_search.html.haml

Summary

Maintainability
Test Coverage
/ Its easier to put the bootstrap in manually, than deal with bootstrap-form
= form_for(request.path, method: 'GET', class: 'navbar-form') do
  / Hack for getting params to pass between searches. Don't include rails generates params
  - builtin_params = %w[controller action utf8 q page]
  - params.reject { |p| builtin_params.include?(p) }.each do |param, value|
    = hidden_field_tag param, value

  .input-group
    = yield
    = text_field_tag(:q, params[:q], placeholder: 'Search', class: 'form-control border-right-0 border')
    %span.input-group-append
      = button_tag(type: 'submit', class: 'btn btn-outline-light border-left-0 border') do
        = inline_svg_tag 'open_iconic/magnifying-glass.svg', class: 'icon'