title: 'nil' is not an ActiveModel-compatible object for searches
body: <p>Ok I was able to overcome the mountain with my searches and getting the results to display properly. However, I have notice that only one of my search options work. The rest gives a "'nil' is not an ActiveModel-compatible object that returns a valid partial path." even when I return the coding back to old. This is strange because my search works perfect for Ethnicity, but for the other parts of the form it returns that error. Perhaps some fresh eyes can catch the culprit.</p>
  
  <p>To clarify on my advanced search page. If I do an Ethnicity search, results pull up. If I do any other search such as for religion, gender, children, etc it gives the nil error. Just doesn't make sense that one option from the search page works and the rest don't when all of them have the same coding. Seems like it's not finding users for it. The error points to "    3 &lt;%= render @users %>"</p>
  
  <p>show.html:</p>
  
  <pre><code>&lt;h1&gt;Search Results&lt;/h1&gt;
  
  &lt;%= render @users %&gt;
  </code></pre>
  
  <p>searches controller:</p>
  
  <pre><code>  def new
      @search = Search.new
    end
  
    def create
      @search = Search.new(params[:search])
      if @search.save
        redirect_to @search
      else
        render 'new'
      end
    end
  
    def show
      @search = Search.find(params[:id])
      @users = @search.users
      end
  
  end
  </code></pre>
  
  <p>search model:</p>
  
  <pre><code> attr_accessible :age, :children, :ethnicity, :gender, :religion, :zip_code
  
    def users
      @users ||= find_users
    end
  
      private
  
    def find_users
      users = User.order(:id)
      users = users.where(gender: gender) if gender.present?
         users = users.where(zip_code: zip_code) if zip_code.present?
         users = users.where(children: children) if children.present?
         users = users.where(religion: religion) if religion.present?
         users = users.where(ethnicity: ethnicity) if ethnicity.present?
    end
  end
  </code></pre>
  
  <p>search form (ethnicity at bottom shows with no error):</p>
  
  <pre><code>&lt;h1&gt;Advanced Search&lt;/h1&gt;
  
  &lt;%= form_for @search do |f| %&gt;
  &lt;div class="field"&gt;
    &lt;%= f.label :gender %&gt;&lt;br /&gt;
    &lt;%= f.select :gender, ['man', 'woman'], :include_blank =&gt; true %&gt;
  &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :zip_code %&gt;&lt;br /&gt;
      &lt;%= f.text_field :zip_code %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :children %&gt;&lt;br /&gt;
      &lt;%= f.select :children, ['Yes, they live with me', 'I want kids now', "I want one someday", "Not for me"], :include_blank =&gt; true %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :religion %&gt;&lt;br /&gt;
      &lt;%= f.select :religion, [["Agnostic", "1"], ["Atheist", "2"], ["Christian", "3"], ["Catholic", "4"], ["Buddhist", "5"], ["Hindu", "6"], ["Jewish", "7"], ["Muslim", "8"], ["Spiritual without affiliation", "9"], ["Other", "10"], ["None", "11"], ["Prefer not to say", "12"]], :include_blank =&gt; true %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :ethnicity %&gt;&lt;br /&gt;
      &lt;%= f.select :ethnicity, [["Asian", "1"], ["Biracial", "2"], ["Indian", "3"], ["Hispanic/Latin", "4"], ["Middle Eastern", "5"], ["Native American", "6"], ["Pacific Islander", "7"], ["White", "8"], ["Other", "9"]], :include_blank =&gt; true %&gt;
    &lt;/div&gt;
    &lt;div class="actions"&gt;&lt;%= f.submit "Search" %&gt;&lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>