Je suis nouveau à ROR, je suivre cette tutorial pour apprendre ROR, cependant, il montre une erreur surROR Débutant question à propos form_for erreur
<%= form_for([@post, @post.comments.build]) do |f| %>
<%= f.error_messages %>
<div class="field">
<%= f.label :commenter %>
<br/>
<%= f.text_field :commenter %>
</div>
<div class="field">
<%= f.label :body %>
<br/>
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
Dans Aptana Studio, il dit:
ActionView::TemplateError (compile error
/home/ming/new/app/views/posts/show.html.erb:31: syntax error, unexpected ')'
...post.comments.build]) do |f|).to_s); @output_buffer.concat(...
^
/home/ming/new/app/views/posts/show.html.erb:51: syntax error, unexpected kENSURE, expecting ')'
/home/ming/new/app/views/posts/show.html.erb:53: syntax error, unexpected kEND, expecting ')') on line #31 of app/views/posts/show.html.erb:
28: <% end %>
29:
30: <h2>Add a comment:</h2>
31: <%= form_for([@post, @post.comments.build]) do |f| %><%= f.error_messages %>
32: <div class="field">
33: <%= f.label :commenter %>
34: <br/>
Alors, une idée?
Oh oui ~~ il semble que le tutoriel officiel a eu quelque chose de mal ... – Cheung