On Sep 24, 10:47 pm, Orient Fang <[email protected]> wrote:
> Hi,
> I'm following the Polymorphic Associations test, issue as following.
>
> **rending views/images/show.html.erb
>
> <p>
>   <b>OwnerName:</b>
>   <%= @image.imageable%>
>
> </p>
> *****

I think @image.imageable returns an ActiveRecord Object, which you
can't just display.  If you are just testing:

@image.imageable.inspect should dump the active record object the
image is related to.

If you are trying to get an attribute of the imageable relation, since
there can be different relations you have to use the imageable_type to
make sure it is there and use something like @image.imageble.name


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to