Hi there!
I m using this form:
<%= form_for(:usage, :url=> {:action =>‘getResults’}) do |f| %>
Select search criteria :<%= f.radio_button :filter, ‘uni’%> For Unicast only
<%= f.radio_button :filter, ‘multi’ %> For Multicasts only
<%= f.radio_button :filter, ‘month’ %> Current Month
<%= f.radio_button :filter, ‘date’ %> On this date:
<%= f.date_select(:date,:order=>[:day,:month,:year])%>
<%= link_to ‘Search’, {:action=>“getResults”}, :remote => true, :submit%>
<% end %>
and in controller I have:
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?