selected items in a multiple select

I have the following line

[code]<%= collection_select_with_current("permissions", :permission,
Permission.find(:all, :order => "name"), :id, :short, @page.permissions,
{:multiple => true}) %></label></p>[/code]

This generates a selectbox, with multipleselect enabled. It posts
correctly, but it does not mark the selected ones as I had hoped it
would. The code is originally from
http://wiki.rubyonrails.org/rails/pages/HowtoUseFormOptionHelpers.

Can anyone help me make the current selected items get the
[code]selected="selected"[/code] tag.

- Emil

<% @all_permissions = Permission.find(:all, :order => “name”) %>

<% @selected = @page.permissions.collect { |p| p.id } %>

<%= options_from_collection_for_select(@all_permissions, :id, :short, @selected) %>

Felipe Mesquita

http://felipemesquita.com