Ruby-on-rails-3 – rails 3: Scaffold Destroy Action Redirects

I created a simple scaffold, the problem is, when I try to delete the record, click destroy rails to redirect to the show action, this is the link code automatically generated when I generate the scaffold :

<%= link_to'Destroy', product, :confirm =>'Are you sure?', :method => :delete %>

What’s wrong?

You need to include rails.js in the application layout, because this link requires JS to use the correct HTTP method. Also make sure to include csrf_meta_tag in the layout.

I created a simple scaffolding, the problem is, when I try to delete the record, click destroy rails to redirect to the show action, This is the link code automatically generated when I generate the scaffold:

<%= link_to'Destroy', product, :confirm =>'Are you sure?', :method => :delete %>

What’s wrong?

You need to include rails.js in the application layout because this link requires JS to use the correct HTTP method. Also make sure to include csrf_meta_tag in the layout.< /p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3349 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.