GeoKit에서 작동하도록 우편 번호 검색을하는 데 문제가 있습니다. 일부 오류로 인해 전체 앱이 다운되고 있습니다. 어떤 도움을 주시면 감사Ruby on Rails : GeoKit 우편 번호 검색?
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"=>"47130",
"format"=>"json"}
Show session dump
Show env dump
Response
Headers:
:
def zipcode
zipcode = params[:zipcode]
@bathrooms = Bathroom.geo_scope(:all, :origin=>[zipcode], :within=>10)
respond_to do |format|
format.json { render :json => @bathrooms }
#format.json { render :json => {:bathrooms => @bathrooms} }
format.js { render :nothing => true }
end
end
match '/bathrooms/zipcode', :controller => 'bathrooms', action =>"zipcode"
이 내가 점점 오전 오류는 다음과 같습니다
이 내가 가진 것입니다.
실제 오류를 넣을 수 있습니까? Rails 로그 (logs/development.log)에서 오류/스택 추적을 찾을 수 있습니다 –
ActionController :: RoutingError ([GET] "/bathrooms/zipcode.json"과 일치하는 경로 없음) : –
Rendered /Library/Ruby/Gems/1.8 /gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.5ms) –