I was up late last night trying to find the cause of this, but I’m
I have this relatively simple controller to load up a bio. It’s basicly
id, name, desc, type (I use STI).
class BioController < ApplicationController
def index @bio = Bio.find(:all, :conditions => ['site_id = ?',
However when I attempt to display the data in the view using this:
I get an error:
undefined method `name’ for #Array:0x3892618
Here is the strange part:
- I saved @bio to the session and looked at the contents and it all
appears to be ok.
- If I change @bio = Bio.find(:all, :conditions => [‘site_id = ?’,
@session[‘site’].id]) to @bio = Bio.find(1) it works fine.
- I ran the SQL using @bio = Bio.find(:all, :conditions => [‘site_id =
?’, @session[‘site’].id]) and it works fine.
- When I display
<%=@bio.type%>it displays “Array” as
opposed to “Bio”.
I’m sure I’m doing something wrong, but I can’t see it at all. Any