Home>

I put a link because I want to delete the posted content, but I get an error.

** index.html.haml **
.header
  = render "header"
.wrapper
  .right_box
    .right_box_bar
    [email protected] posts.each do | post |
      .right_box_bar_name
        = post.name
    .right_box_bar_name_select
      % ul.right_box_bar
        % li
          = link_to "Delete", post_path (@ post.id), method:: delete, class:'destoroy_btn'
        % li
          = link_to "edit", edit_post_path (@ post.id), class:'edit_btn'

Error statement

**the top screen
**. right_box_bar_name_select
% ul.right_box_bar
% li
= link_to "Delete", post_path (@ post.id), method:: delete, class:'destoroy_btn'
% li
= link_to "edit", edit_post_path (@ post.id), class:'edit_btn'

controller
def edit
@post = Post.find (params [: id])
end

def update
post = Post.find (params [: id])
post.update (post_params)
end

def destroy
post = Post.find (params [: id])
post.destroy
end

That's the situation.

From my point of view, I felt that there was a problem with how to write the path using prifix.