开发者

rails paperclip multi upload

开发者 https://www.devze.com 2022-12-26 00:18 出处:网络
has somebody from you followed this tutorial? link text I 开发者_StackOverflow中文版really don´t now why, but I got following fault, when I went through the tutorial word by word:

has somebody from you followed this tutorial? link text

I 开发者_StackOverflow中文版really don´t now why, but I got following fault, when I went through the tutorial word by word:

@album[photo_attributes]‘ is not allowed as an instance variable name

somebody an idea why?


Edited The problem may be from the fact that the variable 'photo' may be nil.

Replace the

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

block with

<%= photo.inspect.to_s %>

and see if this is the case.

Edited

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

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


I had same sort of trouble, and I find this topic link text

I think it will solve your problem

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号