I want to add a like function to a post when I jump to the post details page
While looking at various sites, this time
I made this article for reference.

Error message
NoMethodError in Comments # show
/app/views/comments/show.html.haml where line # 14 raised:
undefined method `keys' for #<Comment: 0x00007f855e5328a8>
Applicable source code
class CreateLikes</pre>
<pre><code data-language = "model">class User</pre>
<pre><code data-language = "model">class Comment</pre>
<pre><code data-language = "model">class Like</pre>
<pre><code data-language = "routes">Rails.application.routes.draw do
  devise_for: usersresources: users, only: [: index,: show]
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  root to: 'posts # index'
  resources: posts, only: [: index]
  resources: comments, only: [: index,: new,: create,: show,: destory,: edit]
  resources: likes, only: [: create,: destroy]
class UserController</pre>
<pre><code data-language = "controller">class LikesController</pre>
<pre><code data-language = "controller">class CommentsController  []})
. contents
  [email protected] comments.each do | comment |
          = comment.place
          -comment.member.each do | member |
            = member.name
      = link_to 'Learn more', "comments/# {comment.id}", method:: get
. contents
        [email protected] comment.member.each do | m |
          = m.name
        = @ comment.place
      = [email protected]
        = @ comment.text
    = render "likes/like", @comment
<% if! current_user? (comment.user)%>
    <% if comment.iine? (current_user)%>
      <% = form_for (comment.likes.find_by (user_id: current_user.id), method:: delete, remote: true) do | f |%>
        <% = button_tag (class: "btn btn-default btn-xs") do%>
          <% = content_tag: span, "#", class: "glyphicon glyphicon-heart"%>
        <% end%>
      <% end%>
    <% else%>
      <% = form_for (comment.likes.build, remote: true) do | f |%>
        <% = hidden_field_tag: comment_id, comment.id%>
        <% = button_tag (class: "btn btn-default btn-xs") do%>
          <% = content_tag: span, "#", class: "glyphicon glyphicon-heart-empty"%>
        <% end%>
      <% end%>
    <% end%>
<% end%>

I wonder if the key is not defined from the error statement
@ comments.id
undefined method `keys' for 1: Integer
The error changes to the contents of.

Supplemental information (FW/tool version etc.)

Please provide more detailed information here.