Actually, it occurred to me after I wrote this that you could do it without any JavaScript at all. In fact, that's what I usually tell people to do first, so I'm surprised I led with the JS example. The thing is, you build the JS version second, as a layer over the HTML version. That way you have a fallback.
In the _item.html.erb partial, you would change the template to include the link helper directly:
<%= content_tag_for item, :li do %>
<h1><%= item.title %></h1>
<%= simple_format item.description %>
<%= link_to 'Comment', new_comment_path(item_id:
item.id) %>
<%- end -%>
Now that link doesn't have to be "magic'd" into the page with JS at all. It is there and it works. Try it out, see how it works. Then layer JS on top of it (if you want to put the comment form into a modal dialog, for example).
Also, rather than continuing with your current project, I suggest you build a "stunt app" just to work out this linking issue. Just cd up a few levels in your drive, and `rails new stunt-app` and `rails scaffold Item name description:text` and `rails scaffold Comment item:references comment:text` That's enough to work with here, and by using scaffold, you will start with a known-working framework without any assumptions. If you're using Rails 5, don't forget to add the optional: true bit to your belongs_to declaration on Comment. Otherwise you will find that you cannot save an Item without comments.
Now to the naming conventions.
If you use the <%= render @items %> trick, then you have to have a file named views/items/_item.html.erb. Inside that partial, the local variable item will be loaded by the Rails framework if you have passed a collection named @items in your render call. All of that is the optimized "magic" way of doing this. It is a shortcut, and it can be expanded to:
<%= render partial: 'items/item', collection: @items %>
If you name the partial something other than the singular of the collection, then you have to use the long form. If your partial is in a different object's view hierarchy than the one that is rendering it, then you also need to put that part in the partial name (how I used items/item above).
So the same thing could be rendered as:
<%= render partial: 'foos/foo', collection: @items %>
and the partial would be changed to name the instance variable inside it 'foo'.
If you really get into the weeds, then you need to have an iterator in the parent page, and really spell it out for Rails:
<%- @items.each do |item| -%>
<%= render partial: 'items/item', locals: { item: item } %>
<%- end -%>
The shortcuts are there to make your production work faster, and if you follow the conventions, then they just work in a way that may confuse you at first. I certainly was confused the first time I did this, particularly when I tried to use a non-conventional setup. It took me a long time for the penny to drop that the name of the instance variable inside the partial was NOT based on the name of the object being rendered, but rather the partial's filename.
Walter