ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/views/shared/_search_form.html.haml

Summary

Maintainability
Test Coverage
.govuk-grid-row
  .govuk-grid-column-two-thirds
    = form_with url: search_path, method: :get do |f|
      = f.hidden_field :tab, id: :tab, value: params[:tab]
      = f.hidden_field :sort, id: :sort, value: params[:sort]
      = f.hidden_field :direction, id: :direction, value: params[:direction]

      = f.govuk_text_field :search,
        label: { text: t('common.search.label'), tag: 'h2', size: 'm' },
        hint: { text: hint_text },
        value: params[:search]

      #search-button
        = f.govuk_submit local_assigns[:button_text] ? button_text : t('common.search.label')

    = yield :search_html_block