Filter by method on model in ActiveAdmin with parameters passed in : <p>Using Rails 4.2.1 and Active Admin 1.0.0.pre2</p>

<p>I have an Apartment model which has many Occupancies. I want admins to be able to see whether an apartment in index overlaps with dates passed in as params. I have a method on Apartment</p>

<pre><code> def available_during(start_date, end_date)
   return !self.occupancies.any? { |occ| occ.date_range_overlap(Date.parse(start_date), Date.parse(end_date)) }
 end
</code></pre>

<p>Which returns true if the apartment has any occupancies that overlap with two given dates. The method <code>date_range_overlap</code> on occupancy is pretty self explanatory. I can't seem to figure out how to make ActiveAdmin's DSL to filter by that method or even make a form to input random params.</p>

<p>I was able to put a column that shows the boolean return value of the available_during method in the index. </p>

<pre><code>if params[:from] &amp;&amp; params[:until]
  column "available?" do |apt|
    apt.available_during(params[:from], params[:until])
  end
end
</code></pre>

<p>But I can only seem to get this to work by manually inputting the from and until params in the url. </p>

<p>How might I place an arbitrary search form to send the user to the right params? Or better yet, make a filter in that sidebar that uses that method? </p>
