Do it in the ERB file:
<%= select_tag "worker[factory_id]", options_from_collection_for_select(@state_factories... %>
Although, I'd use the select helper:
<%= select "worker", "factory_id", options_from_collection_for_select(@state_factories... %>
As that would automatically select the factory on edit.