title: Radio button condition ruby on rails
body: <p>I am having some issues with this code. I am trying to create an "advance" search for my database. Requesting two types of data (film and location). The location one work flawlessly and displays all the cinemas near to a location. But is it possible to do so with entering in a specific name of a movie?</p>
  
  <pre><code>Location Controller:
  if params[:allcinemas].checked?
    if params[:search].present?
      @locations = Location.near(params[:search], 10, :order =&gt; :distance)
      @title = "Search Results:"
    else
      @locations = Location.joins(:cinema).order("cinemas.name").all
      @title = "Locations of Cinemas"   
    end
  elsif params[:allmovies].checked?
    if params[:search].present?
      @films = Film.near(params[:search], :order =&gt; :title)
    else
      @films = Film.find(:all, :order =&gt; "title") 
    end
  </code></pre>
  
  <p>This is the Show.Html.erb for the locations</p>
  
  <pre><code>show.html.erb
  &lt;p&gt;
   &lt;%= text_field_tag :search, params[:search] %&gt;
   &lt;%= submit_tag "Search Nearby Cinemas", :name =&gt; nil %&gt;
   &lt;br&gt;&lt;%= radio_button_tag 'allcinemas', 'cinemas', true %&gt; Cinemas
   &lt;br&gt;&lt;%= radio_button_tag 'allmovies', 'movies' %&gt; Movies
  &lt;/p&gt;
  </code></pre>