Forum: Ruby on Rails expected, got Fixnum problem.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
036be8d5d83a98e546b98d64e3fd6c20?d=identicon&s=25 Sam Donaldson (Guest)
on 2006-05-30 10:19
(Received via mailing list)

I was wondering if anybody knew what '<some type> expected, got Fixnum'
means?  My code looks like the following:

      anevent =
      anevent.title = params["event"]["title"]
      anevent = session[:user_id]
      com = Community.find(params[:id]) << anevent
rescue Exception => exc

But I get an exception.

Thanks a lot.
Ec5a599777854c540fd102ef4691fe10?d=identicon&s=25 Rimantas Liubertas (Guest)
on 2006-05-30 11:17
(Received via mailing list)
>       anevent =
>       anevent = session[:user_id]

Is this what you really want?

C29d9db03853958c4de5ee6b06edd39a?d=identicon&s=25 Nicolas Buet (Guest)
on 2006-05-30 11:24
(Received via mailing list)
<some type> expected, got Fixnum: that means that you try to assign a
(an integer...) into something else, and it is not possible to cast the
fixnum into that something (okay, I'm not sure this helps, I find the
quite clear if you read it)

Your line:
anevent = session[:user_id]
is suspicious. You try to assign session[:user_id] to anevent, and
probably no way you can cast a Fixnum into an Event object,
036be8d5d83a98e546b98d64e3fd6c20?d=identicon&s=25 Sam Donaldson (Guest)
on 2006-05-30 11:27
(Received via mailing list)
ah, missed that.  sorry and thanks.

This topic is locked and can not be replied to.