Need help with using Radio Buttons with Metawhere

I want to use radio buttons to allow a user to select one of three

  1. retrieve all users that have :status == 0;
  2. retrieve all users that have :status == 1;
  3. retrieve all users (:status == 0 | 1).

I tried this:
<%= radio_button_tag(:search, :status_gt, 0) %>
<%= label_tag(:status_gt, “Available”) %>

<%= radio_button_tag(:search, :status_lt, 1) %>
<%= label_tag(:status_lt, “Unavailable”) %>

<%= radio_button_tag(:search, :status_gte, 0) %>
<%= label_tag(:status_gte, “Both”) %>

I am using the MetaWhere and MetaSearch gems, which take the “status_gt”
“status_lt” symbols and converts them into a SQL query string operating
the :status column.

How do I format the radio_button_tag to send the :search parameter for
:status column based on which button the user selected?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs