Forum: Ruby on Rails expected, got Fixnum problem.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sam D. (Guest)
on 2006-05-30 12:19
(Received via mailing list)
Hi,

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

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

But I get an exception.

Thanks a lot.
Rimantas L. (Guest)
on 2006-05-30 13:17
(Received via mailing list)
>       anevent = Event.new
<...>
>       anevent = session[:user_id]

Is this what you really want?


Regards,
Rimantas
--
http://rimantas.com/
Nicolas B. (Guest)
on 2006-05-30 13:24
(Received via mailing list)
<some type> expected, got Fixnum: that means that you try to assign a
fixnum
(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
error
quite clear if you read it)

Your line:
anevent = session[:user_id]
is suspicious. You try to assign session[:user_id] to anevent, and
there's
probably no way you can cast a Fixnum into an Event object,
Sam D. (Guest)
on 2006-05-30 13:27
(Received via mailing list)
ah, missed that.  sorry and thanks.

saureen.
This topic is locked and can not be replied to.