aantix / turkee

Blurring the line between Mechanical Turk, Rails and usability testing..
http://github.com/aantix/turkee
MIT License
152 stars 39 forks source link

Making Sandbox accessing local form? #29

Closed novito closed 10 years ago

novito commented 10 years ago

Awesome gem!

When you guys say:

Mechanical Turk will open your forms in an iFrame from a secure URL (ssl). If you test locally with localhost, you're going to need to be running SSL so that you don't receive a mixed content warning within Chrome and a blank screen. Thin allows for local SSL.

How do you make the Amazon Sandbox access the form that is in my local server?

aantix commented 10 years ago

Mechanical Turk just opens an iFrame with whatever URL that has been passed.

Take a look at the create_hit method: https://github.com/aantix/turkee/blob/master/lib/models/turkee_task.rb

If you pass localhost:3000 as the host, Mechanical Turk will just open an iFrame pointed at that local address. As long as you're running your local server, you're able to see your local form.

novito commented 10 years ago

@aantix Thanks for the quick reply. I believe I have some kind of confusion here. If I pass the localhost:3000/my_form to Mechanical Turk, wouldn't my local server need to be public available. Otherwise, how does Amazon Turk knows where is that local server when trying to fetch the URL in the iframe?

aantix commented 10 years ago

No. If you're just testing locally and create a test HIT, when you open the page, the iframe is pointed at localhost:3000. Since you are viewing the HIT on the same machine that is running your local server, you can see your forms loaded within the iframe.

novito commented 10 years ago

palmface. Thanks aantix, and looking forward to submit pull requests on this gem.