Multi-user download

have any of you followed this tutorial? link text

I don't really understand why, but I got the following error when I read the tutorial word by word:

@album [photo_attributes] 'not resolved as instance variable name

Anyone have any idea why?

+2


source to share


2 answers


Edited The problem may be that the "photo" variable may be zero.

Replace

<% fields_for ... %>
 ...
<% end %>

      

block with

<%= photo.inspect.to_s %>

      



and see if it really is.

Edited

Try the monkey patch: put Photo.new instead of a photo

<% fields_for 'album[photo_attributes][]', Photo.new do |u| %>

      

+1


source


I had the same problem and I find this topic link text



I think this will solve your problem.

0


source







All Articles