Ruby Active Record Associations in Rails Using Associations in Your App Creating an Associated Record

Muhammad sharifi
Muhammad sharifi
4,454 Points

_form.html.erb errors

<%= form_for [@post, comment] do |f| %>
  <div class="field">
    <%= f.label :name %>
    <%= f.text_field :name %>

this is giving me the error of NameError in Comments#edit anyone can help?

1 Answer

Ethan Rivas
Ethan Rivas
9,973 Points

Hello Muhammad sharifi,

Based on the code you placed here, I can say that you're missing the closing <% end %> tag of your form.

Is that all your code?