<%= form_for(:usage, :url=> {:action =>'getResults'}) do |f| %>
<legend>Select search criteria : </legend>
<%= f.radio_button :filter, 'uni'%> <span style="font-size:15px;">For Unicast only</span>
<br>
<%= f.radio_button :filter, 'multi' %> <span style="font-size:15px;">For Multicasts only</span>
<br>
<%= f.radio_button :filter, 'month' %> <span style="font-size:15px;">Current Month</span>
<br>
<%= f.radio_button :filter, 'date' %> <span style="font-size:15px;">On this date:
<br><br>
<%= f.date_select(:date,:order=>[:day,:month,:year])%>
<br>
<%= link_to 'Search', {:action=>"getResults"}, :remote => true, :submit%>
<% end %>
def getResults
if params[:filter] == 'uni'
@results = Multicasts.where(:sms_voice => 'sms')
end
if params[:filter] =='multi'
@results = Multicasts.where(:when => 'im')
end
if params[:filter] =='month'
@results = Multicasts.where('extract(month from datetime) = ?', MONTH(date))
end
render :new_results
end
Is this a correct way to read info from radio buttons.
Please help, it is not working. Is the syntax correct?