在试图让土耳其人工作时,我得到了一个undefined method
reverse_merge!对于 nil:NilClass` 错误。
我的代码:
class MechanicalTurksController < ApplicationController
def new
@mechanical_turk = MechanicalTurk.new
@disabled = Turkee::TurkeeFormHelper::disable_form_fields?(params)
end
end
<%= turkee_form_for(@mechanical_turk, params) do |f| %>
<%= f.label :first_name %>
<%= f.text_field :first_name, disabled: @disabled %>
<br />
<%= f.submit "Save", class:"btn btn-primary", disabled: @disabled %>
<% end %>
class MechanicalTurk < ActiveRecord::Base
end
我认为问题在于params
哈希。我认为它缺少一些东西。文件说
Mechanical Turk 现在要求将 hitId、workerId 和 turkSubmitTo 参数与 assignmentId 和表单参数一起传递。
这是我的日志的输出:
Started GET "/mechanical_turks/new?assignmentId=ASSIGNMENT_ID_NOT_AVAILABLE&hitId=2Z2MN9U8P9Y3B78UW1US1YIM5R7VEG" for 208.54.40.228 at 2012-05-08 17:35:24 -0400
Processing by MechanicalTurksController#new as HTML
Parameters: {"assignmentId"=>"ASSIGNMENT_ID_NOT_AVAILABLE", "hitId"=>"2Z2MN9U8P9Y3B78UW1US1YIM5R7VEG"}
Rendered mechanical_turks/new.html.erb within layouts/application (0.9ms)
Completed 500 Internal Server Error in 2ms
ActionView::Template::Error (undefined method `reverse_merge!' for nil:NilClass):
1: <%= turkee_form_for(@mechanical_turk, params) do |f| %>
2: <%= f.label :first_name %>
3: <%= f.text_field :first_name, disabled: @disabled %>
4:
app/views/mechanical_turks/new.html.erb:1:in `_app_views_mechanical_turks_new_html_erb___897197135_79286580'
我还在GitHub 上发布了一个问题。