1
所以,我使用的载波,以允许用户上传个人资料图片。现在最终,我希望用户能够点击图片并在profile.html.haml页面上即时上传新图片。找不到有效的映射零
所以,我一直在尝试,下面添加一个形式看跌期权操作,让用户即时更新的图像,而不必去edit.html.haml页面。
不过,我被击中,出现此错误:
Could not find a valid mapping for nil
Extracted source (around line #8):
<%= form_for(@user, :url => registration_path(@user), :html => { :method => :put }, :html => {:multipart => true}) do |f| %>
<%= link_to (image_tag current_user.profile_image_url(:thumb).to_s), edit_account_path(current_user)%>
<% end %>
哪儿我去错了吗?
或者我已经试过这可能是完全关闭:
<%= link_to (image_tag current_user.profile_image_url(:thumb).to_s), f.file_field :profile_image%>
这给了这个错误:
Sites/Friendiose-master/app/views/home/landing_welcome.html.erb:9: syntax error, unexpected tSYMBEG, expecting ')'
...l(:thumb).to_s), f.file_field :profile_image);@output_buffer...
在先进的感谢。
感谢肖恩,但它的载波不回形针我应该提到的是遗憾。问题出在表单不是用image_tag语法。你使用团队查看器吗? –
你的错误是与任何是LANDING_PAGE线9.哪个是IMAGE_TAG因为它说,它在下面 –
@SonnyBlack的错误,您可以勾选答案,如果它帮助。 –