J. Rodrigo Fuentes
2011-Mar-14 15:17 UTC
Need help with using Radio Buttons with Metawhere
I want to use radio buttons to allow a user to select one of three options:
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:
<%*<strong><u>Availability</u></strong><br/>%>
<%= radio_button_tag(:search, :status_gt, 0) %>
<%= label_tag(:status_gt, "Available") %><br/>
<%= radio_button_tag(:search, :status_lt, 1) %>
<%= label_tag(:status_lt, "Unavailable") %><br/>
<%= radio_button_tag(:search, :status_gte, 0) %>
<%= label_tag(:status_gte, "Both") %><br/>
I am using the MetaWhere and MetaSearch gems, which take the
"status_gt" and
"status_lt" symbols and converts them into a SQL query string
operating on
the :status column.
*How do I format the radio_button_tag to send the :search parameter for the
:status column based on which button the user selected?*
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.