0
在試圖獲得turkee工作,我得到一個undefined method
reverse_merge!'爲零:NilClass`錯誤。turkee:未定義的方法`reverse_merge!'爲零: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。