Ruby on rails RubyonRails-解析url

Ruby on rails RubyonRails-解析url,ruby-on-rails,ruby,web-services,Ruby On Rails,Ruby,Web Services,我在控制器中接收数据时遇到问题。我必须在web服务控制器中接收参数,但我有以下问题。我研究并发现rails解析中存在这个问题。这篇文章就是关于这个问题的。我想自己找到一些解析它的方法。我只想以ulr的最后一个相同项为例,例如job_name=*。 发生此错误后,我在控制器中未收到任何数据。这是请求和错误 localhost:3000/ws/job_历史记录/索引?job_name=name&job_name[]=* 状态:500内部服务器错误 nil:NilClass的未定义方法每个_对 or

我在控制器中接收数据时遇到问题。我必须在web服务控制器中接收参数,但我有以下问题。我研究并发现rails解析中存在这个问题。这篇文章就是关于这个问题的。我想自己找到一些解析它的方法。我只想以ulr的最后一个相同项为例,例如job_name=*。 发生此错误后,我在控制器中未收到任何数据。这是请求和错误


localhost:3000/ws/job_历史记录/索引?job_name=name&job_name[]=*

状态:500内部服务器错误

nil:NilClass的未定义方法
每个_对
org/jruby/RubyKernel.java:238:in
method\u missing'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activesupport/lib/active_support/whiny_nil.rb:52:in
方法\u缺失'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activesupport/lib/active_support/core_ext/hash/interference_access.rb:46:in
更新'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activesupport/lib/active_support/core_ext/hash/interference_access.rb:91:in
merge'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/request.rb:385:in
参数'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/base.rb:1290:in
assign_shortcuts'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/base.rb:527:in
process'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in
使用过滤器处理\u'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/rescue.rb:65:in
call_with_exception'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:90:in
dispatch'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in
dispatch'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:85:in
dispatch'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in
\u呼叫'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in
build\u middleware\u stack'org/jruby/RubyProc.java:270:in
call'
org/jruby/RubyProc.java:220:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/string_胁迫。rb:25:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/head.rb:9:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:177:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
cache'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in
cache'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/lock.rb:11:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/lock.rb:11:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in
run'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/railties/lib/rails/rack/static.rb:31:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/urlmap.rb:49:in
调用'org/jruby/RubyArray.java:1612:in
each'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/content_length.rb:13:in
call'
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/chunked.rb:15:in
呼叫“
C:/skybot/int_3_6/skybot-2.0/gui/vendor/gems/rack-1.1.3/lib/rack/handler/mongrel.rb:67:in
process'
C:/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:159:in
process\u client'org/jruby/RubyArray.java:1612:in
each'
C:/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:158:in
process\u client'
C:/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:110:in
process\u client'
C:/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:285:in
run'org/jruby/RubyProc.java:270:in
call'
org/jruby/RubyProc.java:224:in
call'


我本来打算写一篇评论,但这里会更清楚:

undefined method each_pair' for nil:NilClass
此错误表示您正在对不存在的数据对象调用方法/函数。考虑到您试图从端点调用数据,您需要向我们展示<
localhost:3000/ws/job_histories/index?job_name[]=name