ActiveRecord::AssociationTypeMismatch in AdminController#create
Product expected, got Product
here's the action...
def create
@user = User.current
@product = Product.new(params[:product])
if @user.products << @product
flash[:notice] = 'Product was successfully created.'
redirect_to :action => 'index'
else
render :action => 'new'
end
end
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:148:in
`raise_on_type_mismatch'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:24:in
`<<'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:23:in
`<<'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in
`transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:95:in
`transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:121:in
`transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:22:in
`<<'
#{RAILS_ROOT}/app/controllers/admin_controller.rb:22:in `create'
/usr/local/bin/mongrel_rails:18
Thanks,
jeff
--