我该如何修复这个语法错误?
当我加载视频显示视图时,我收到此错误:
SyntaxError in Videos#show
Showing /rubyprograms/dreamstill/app/views/comments/new.html.erb where line #1 raised:
compile error
/rubyprograms/dreamstill/app/views/comments/new.html.erb:1: syntax error, unexpected tASSOC, expecting kEND
...deo.comments.new]), :remote => true do |f| @output_buffer.sa...
^
/rubyprograms/dreamstill/app/views/comments/new.html.erb:6: syntax error, unexpected kENSURE, expecting $end
它指向我的 comments/new.html.erb 文件中的此表单:
<%= simple_form_for([@video, @video.comments.new]), :remote => true do |f| %>
<%= f.association :comment_title, :collection => @video.comment_titles, :label => "Comment Title:", :include_blank => false %>
<%= f.input :body, :label => false, :placeholder => "Post a comment." %>
<%= f.button :submit, :value => "Post" %>
<% end %>
该文件使用此行加载到我的视频显示视图中:
<%= render :file => 'comments/new' %>
如何修复此错误?
I get this error when I load my video show view:
SyntaxError in Videos#show
Showing /rubyprograms/dreamstill/app/views/comments/new.html.erb where line #1 raised:
compile error
/rubyprograms/dreamstill/app/views/comments/new.html.erb:1: syntax error, unexpected tASSOC, expecting kEND
...deo.comments.new]), :remote => true do |f| @output_buffer.sa...
^
/rubyprograms/dreamstill/app/views/comments/new.html.erb:6: syntax error, unexpected kENSURE, expecting $end
It points to this form in my comments/new.html.erb file:
<%= simple_form_for([@video, @video.comments.new]), :remote => true do |f| %>
<%= f.association :comment_title, :collection => @video.comment_titles, :label => "Comment Title:", :include_blank => false %>
<%= f.input :body, :label => false, :placeholder => "Post a comment." %>
<%= f.button :submit, :value => "Post" %>
<% end %>
which is loaded into my video show view with this line:
<%= render :file => 'comments/new' %>
How can I fix this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你想要:
基本上
:remote => true
应该是 simple_form_for 的一个参数。You want:
Basically the
:remote => true
was supposed to be a parameter of simple_form_for.尝试:
Try: