0

In trying to get turkee working, I'm getting an undefined methodreverse_merge!' for nil:NilClass` error.

My Code:

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

I think the problem is the params hash. I think it's missing something. The documentation says

Mechanical Turk is now requiring that the hitId, workerId, and the turkSubmitTo parameters be passed in along with the assignmentId and form parameters.

Here's the output from my logs:

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'

I've also posted an issue on GitHub.

Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196

1 Answers1

0

Used most recent release from github and it works now.

Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196