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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060530/beee173a/attachment.html
> anevent = Event.new<...>> anevent = session[:user_id]Is this what you really want? Regards, Rimantas -- http://rimantas.com/
<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, On 5/30/06, Sam Donaldson <samonderous@gmail.com> wrote:> > 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. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060530/c30ea9bb/attachment.html
ah, missed that. sorry and thanks. saureen. On 5/30/06, Nicolas Buet <nicolas.buet@gmail.com> wrote:> > <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, > > On 5/30/06, Sam Donaldson <samonderous@gmail.com> wrote: > > > 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. > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060530/7fc677e9/attachment.html