title: Ruby on Rails: GeoKit Zipcode Search?
body: <p>I am having problems getting a zip code search to work with GeoKit. Some error is making the whole app crash.</p>
  
  <p>This is what I have:</p>
  
  <pre><code> def zipcode
      zipcode = params[:zipcode]
      @bathrooms = Bathroom.geo_scope(:all, :origin=&gt;[zipcode], :within=&gt;10)
      respond_to do |format|
        format.json  { render :json =&gt; @bathrooms }
        #format.json { render :json =&gt; {:bathrooms =&gt; @bathrooms} }
        format.js   { render :nothing =&gt; true } 
       end        
    end
  
  
  
  
   match '/bathrooms/zipcode', :controller =&gt; 'bathrooms', action =&gt;"zipcode"
  </code></pre>
  
  <p>This is the error I am getting:</p>
  
  <pre><code> ArgumentError in BathroomsController#zipcode
  
  wrong number of arguments (2 for 1)
  
  Rails.root: /Users/chance 1/source/rails_projects/squat
  Application Trace | Framework Trace | Full Trace
  
  app/controllers/bathrooms_controller.rb:44:in `geo_scope'
  app/controllers/bathrooms_controller.rb:44:in `zipcode'
  
  Request
  
  Parameters:
  
  {"zipcode"=&gt;"47130",
   "format"=&gt;"json"}
  
  Show session dump
  
  Show env dump
  Response
  
  Headers: 
  </code></pre>
  
  <p>Any help appreciated.</p>