Tôi có đoạn mã sau nhưng tôi không thể hiểu được việc định tuyến nào xảy ra cho form_for ([@ article, @ article.comments.build]). Ruby on Rails Form Với hai tham số
Title: <% = @ article.title%>
<p>
<strong>Text:</strong>
<%= @article.text %>
</p>
<h2>Add a comment:</h2>
<%= form_for([@article, @article.comments.build]) do |f| %>
<p>
<%= f.label :commenter %><br>
<%= f.text_field :commenter %>
</p>
<p>
<%= f.label :body %><br>
<%= f.text_area :body %>
</p>
<p>
<%= f.submit %>
</p>
<% end %>
<%= link_to 'Back', articles_path %>
| <%= link_to 'Edit', edit_article_path(@article) %>
Giải thích thực sự tốt. – Niyanta