Marco De Rossi said over 3 years ago on Like Relationships and Global ID :
  Thanks, I had a typo.  I have loop all users liked posts on the user profile page.  I get this error when I add the unfollow link
undefined method `to_sgid

## user_profile.html.erb
@liked_post.each do |post|%>

link_to  "Unfollow",posts_like_path(post, id: @liked_post.to_sgid(expires_in: 1.hour)),method: :delele

## users_controller

def user_profile
  @user= current_user
  @posts = @user.posts.all 
  @liked_post = @user.liked_post   
 end

This setup works fine on the post-show page but not on the user profile page