Iam working on ruby 1.8.7 and rails 3.0.5. After creating products table and changing the default scaffold code in index.html.erb, the following is the code.
Listing products<% @products.each do |product| %> <%= image_tag(product.image_url, :class => 'list_image') %>
- <%= product.title %>
- <%= truncate(strip_tags(product.description), :length => 80) %>
<%= link_to 'Edit', edit_product_path(product) %>
<%= link_to 'Destroy', product, :confirm => 'Are you sure pakka?', :method => :delete %> <% end %>
<%= link_to ‘New Product’, new_product_path %>
The file executed over the browser very well but the problem is when i click the link Destroy it is navigating to the page similar to Show link rather than displaying the page with “Are you sure you want to delete” where we can delete the product from the list of products. can any one solve this issue from me please.