has_many, belongs_to and comment forms
- by Koning Baard XIV
I'm having two models: Snippet and SnippetComment. These also have their own controllers, as well as views. In /app/views/snippets/show.html.erb I have a form that starts like this:
<% form_for(@new_snippet_comment) do |form| %>
SnippetComment belongs to one Snippet, and a Snippet belongs to one User. This means that I have this routing:
…