I’m new to rails and I’m following the first tutorial on api.rubyonrails.org.
However, I’ve finished the entire tutorial except for a specific problem I’ve skipped.
The following partial isn’t working:
<%= render :partial => 'comments/comment',
:collection => @post.comments %>
For some reason, it throws the following error:
Missing partial comments/comment with
{:handlers=>[:erb, :builder], :formats=>[:html], :locale=>[:en, :en]}. Searched in:
* "c:/rails/blog/app/views"
I don’t quite understand what the purpose of :collection is(perhaps someone could elaborate).
You can find see the files on my github repo below:
http://github.com/imjp/blog
You simply misspelled the name of the partial:
instead of:
For the explanation of
collectionsee here: http://guides.rubyonrails.org/layouts_and_rendering.html#using-partialsPara 3.4.5