I’am trying to create a search sytem with two arguments
When one argument is choosen it needs find all the objects with that
argument
and when two choosen it needs to find all objects with both arguments.
In my view
<% form_tag :action => ‘tuinen’, :method => ‘get’ do %>
<%= options = [[“Selecteer een provincie”, “”]] + User::PROVINCES
select(“search”, nil, options)
%>
<%= select ‘heading’, nil, Heading.find(:all).collect {|p| [ p.name,
p.id ] }, { :prompt => “selecteer een rubriek”} %>
<%= submit_tag “Zoek mijn tuin”%>
<% end %>
the problem is into my controller i can’t find no way to seperate the
aruments
i tried several methods but nothing works
my basic method is like this
if @params[:search]
@gardens = Garden.find(:all, :conditions => {:provincie =>
@params[:search], :heading_id => @params[:heading], :destroyed => 0})