我正在尝试将头像上传字段添加到我的个人资料页面,但是一旦我添加:html => {:multipart => true}
到它,它就会吐出一个语法错误。
<%= form_for(@user), :html => { :multipart => true } do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.email_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.label :password_confirmation, "Confirmation" %>
<%= f.password_field :password_confirmation %>
<%= f.label :avatar %>
<%= f.file_field :avatar %>
<%= f.submit "Save changes", class: "btn btn-large btn-primary" %>
<% end %>
错误是:
syntax error, unexpected tASSOC, expecting keyword_end
...end= form_for(@user), :html => { :multipart => true } do |f...
... ^