Having trouble with collection_select helper


I am having difficulty with extracting data from the collection_select
form helper.

First, the code:

  1. view ->>
    <%= collection_select :colors, :id, send_colors, :id, :color %>

  2. view helper that polulates collection_select ‘send_colors’ -->>
    def send_colors
    @colors = Color.find(:all)

  3. controller ->>
    def create
    @color = Color.new(params[:color])

My problem is that when I submit the form, @color (in the controller) is
not being populated with any data. I have inspected the @color object
and it’s attributes are empty. When I view the HTML source in the web
browser, the select form value options are there but seemingly not
submitted back to controller. Perhaps my controller code is wrong.

Also, here’s some debug YAML output
<%= debug(params) %>
— !map:HashWithIndifferentAccess
commit: Save changes
action: create_debug
controller: admin
color: !map:HashWithIndifferentAccess
id: “1”

<%= debug(@color) %>
— !ruby/object:Color
new_record: true

<%= debug(request) %>

partial output
#<ActionController::CgiRequest:0x3604d40 @parameters={“commit”=>“Save
changes”, “action”=>“create_debug”, “controller”=>“admin”,

What is this ‘HasWithIndifferentAccess’ about? Is this my problem?

Thanks for any assistance in advance!