【发布时间】:2013-11-28 18:56:07
【问题描述】:
所以,我使用载波来允许用户上传个人资料图片。现在,最终,我希望用户能够单击图像并在 profile.html.haml 页面中即时上传新图像。
所以,我尝试在下面添加一个带有 put 操作的表单,让用户无需转到 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...
提前致谢。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 devise ruby-on-rails-4 carrierwave