rails/rails — pull request #11983 by njakobsen (2013-08-22 18:58:17+00:00)
Title: Fix collection labels not including form namespace.

Present in Rails 4-0-stable and in master.

This bug would prevent clicks on labels for collection form elements (radio buttons and check boxes) from selecting the associated input because the label's "for" attribute doesn't include the form namespace.

The bug can be replicated with the following code.
```erb
<%= form_for Struct.new(:terms).new, :as => 'fakemodel', :url => '', :namespace => 'NAMESPACE' do |f| %>
<%= f.label :terms %> Non-collection label has correct ID that includes namespace

<%= f.collection_radio_buttons :terms, ["Test option"], :to_s, :to_s %> Collection label has incorrect FOR attribute value that doesn't include the namespace
<% end %>
```

I'm unsure of how to test this as the form_collections_helper_test.rb doesn't seem to have any way to set up the form options. Any suggestions are welcome.