On 26 January 2012 18:38, Yara Mayer <yaramayer@gmail.com> wrote:
> Hi!!
>
> I have a few models that use a Photo polymorphic model. It's all good
> and fine for saving or accessing the photos' attributes via console or
> inspect or logger, but if I try to call them directly in the view
> with, for example, @banner.photo.file, it returns a undefined method
> 'file' etc for nil:Nil
That means that @banner.photo is nil. Add code to your view to test
@banner.photo before accessing @banner.photo.file.
Colin
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment