title: How to make radio buttons not clear after submitting Rails filter
body: <p>I have a Rails app with a filter. The filter consists of two radio buttons. If the radio button &quot;en&quot; is selected, the english users are displayed and the same with &quot;es&quot; and spanish users.</p>
  <p>This works fine. I can filter for english and spanish users. However, when the form is submitted, the selected radio button is cleared.</p>
  <p>How do I make it that the selected radio button is still selected after submitting the form?</p>
  <p>_filter.html.erb:</p>
  <pre><code>&lt;%= form_with url: '/filter_users', method: :get do | form|%&gt;
    &lt;%= form.radio_button :language, 'en', onclick: &quot;this.parentNode.submit();&quot;%&gt;
    &lt;%= form.label :language_en, 'en' %&gt;
    &lt;%= form.radio_button :language, 'es', onclick: &quot;this.parentNode.submit();&quot; %&gt;
    &lt;%= form.label :language_es, 'es' %&gt;
  &lt;% end %&gt;
  </code></pre>
  <p>controller:</p>
  <pre><code>  def filter_users
      @users = User.all
      @users = @users.filter_by_language(params[:language]) if params[:language].present?
    end
  </code></pre>
  <p>model:</p>
  <pre><code>class User &lt; ApplicationRecord
    scope :filter_by_language, -&gt;(language) { where language: language }
  end
  </code></pre>
  <p>I hope my question is clear. Thank you</p>