Skip to content

Instantly share code, notes, and snippets.

@manishdas
Created September 1, 2011 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishdas/1185518 to your computer and use it in GitHub Desktop.
Save manishdas/1185518 to your computer and use it in GitHub Desktop.
line = CF::Line.create("Bizzcardarmy","Digitization") do |l|
# creation of initial input_formats for line with (Company, Website)
CF::InputFormat.new({:line => l, :name => "Company", :required => true})
CF::InputFormat.new({:line => l, :name => "Website", :required => true, :valid_type => "url"})
# creation of first station with input_format Company and without Website
CF::Station.create({:line => l, :type => "work"}) do |s|
CF::HumanWorker.new({:station => s, :number => 1, :reward => 20})
CF::TaskForm.create({:station => s, :title => "Enter the name of CEO", :instruction => "Describe"}) do |i|
CF::FormField.new({:form => i, :label => "First Name", :field_type => "short_answer", :required => "true"})
CF::FormField.new({:form => i, :label => "Middle Name", :field_type => "short_answer"})
CF::FormField.new({:form => i, :label => "Last Name", :field_type => "short_answer", :required => "true"})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment