Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2008 08:19
Show Gist options
  • Save anonymous/2621 to your computer and use it in GitHub Desktop.
Save anonymous/2621 to your computer and use it in GitHub Desktop.
## /users/edit.html.erb
<% form_for [:cp, @user], :url => { :action => 'update', :id => @user.id } do |f| %>
...
<%= collection_select :users, :show_id, Show.find(:all), :id, :name, { :prompt => true } %>
## users_controller.rb
@user.shows << params[:users][:show_id]
## error
ActiveRecord::AssociationTypeMismatch in Cp/usersController#update
Show(#28733190) expected, got String(#104960)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment