Basit bir test uygulamasında aşağıdaki hatayı alıyorum Rails'i öğrenmek için üzerinde çalışıyorum.Sözdizimi hatası, beklenmedik ' n', tCOLON2 veya '[' or '.'
syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.'
O bir undexpected bölünme olmadığı olmak söylüyor, ama ben aşağıda benim koduyla yanlış anlamaya olamayacağını görüntülenir:
#app/views/quotations/index.html.erb
<% title "Quotations" %>
<table>
<tr>
<th>Quote Text</th>
<th>Author</th>
<th>Quote type</th>
<th>Category</th>
<th>Tags</th>
</tr>
<% for @quotations.each do |quotation| %>
<tr>
<td><%= quotation.quote_text %></td>
<td><%= quotation.author %></td>
<td><%= quotation.quote_type %></td>
<td><%= quotation.category %></td>
<td><%= quotation.tags %></td>
<td><%= link_to "Show", [@user, quotation] %></td>
<td><%= link_to "Edit", edit_user_quotation_path(@user, quotation) %></td>
<td><%= link_to "Destroy", [@user, quotation], :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<p><%= link_to "New Quotation", new_user_quotation_path(@user) %></p>
ben yapabilirsiniz kapsamlı bu googled ve ettik Kodumda neyin yanlış olduğunu anlamayacağım. Teşekkürler!
satırından kaldırırsanız, bu işe yaramalıdır Ruby için yeni iseniz sık karşılaşılan bir hatadır. Ben de sorun vardı .. –