2011-04-07 10 views
2

이 구문 오류를 어떻게 해결할 수 있습니까?

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 

그것은 내 의견/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' %> 

이 오류를 어떻게 해결할 수 있습니까?

답변

8

당신이 원하는이 :

<%= simple_form_for([@video, @video.comments.new], :remote => true) do |f| %> 

은 기본적으로 :remote => true는 simple_form_for의 매개 변수 있어야했다.

5

시도 :

<%= simple_form_for [@video, @video.comments.new], :remote => true do |f| %> 
관련 문제