将JSON数据作为参数传递 - RequestURITooLarge

时间:2014-02-24 10:38:30

标签: ruby-on-rails ruby json webrick

我正在尝试将几乎大的json数据作为参数发送到我的rails项目中的一个控制器,如下所示:

<%= link_to "Select", channel_path(:hit => "#{json_data["clips"]}") %>

但我明白了:

[2014-02-24 10:34:38] ERROR WEBrick::HTTPStatus::RequestURITooLarge
[2014-02-24 10:34:38] ERROR TypeError: can't convert nil into an exact number
    /home/vagrant/htdocs/htdocs/cac-verticals/.gems/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/time/calculations.rb:326:in `-'
    /home/vagrant/htdocs/htdocs/cac-verticals/.gems/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/time/calculations.rb:326:in `minus_with_duration'
    /home/vagrant/htdocs/htdocs/cac-verticals/.gems/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/time/calculations.rb:337:in `minus_with_coercion'
    /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/accesslog.rb:111:in `setup_params'
    /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:219:in `access_log'
    /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:111:in `run'
    /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

我还尝试使用thin代替webrick,但瘦也抱怨大请求。

有什么建议吗? TNX。

0 个答案:

没有答案