select and passing some javascript

some code:
-------------------------------------------------------------
return select(:id, :year, [ ['2008', 2008],
       ['2007', 2007],
       ['2006', 2006]], :selected => session[:user_year], :onChange =>
'enterprise_function();' )

I believe you want

select(:id, :year, [ ['2008', 2008],
       ['2007', 2007],
       ['2006', 2006]], {:selected => session[:user_year]}, :onChange =>
'enterprise_function();' )

Fred

It's the other way round. The first hash is options, which takes
selected and a few other things. The second hash (html_options) goes
straight out to the rendered html, so if you put 'foo' => 'bar' then
your select tag would have foo="bar" as an attribute.

Fred