ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Rolling with Ruby on Rails
Subject:   Homework #1 issues
Date:   2006-09-11 20:54:52
From:   m3_del
I am atempting to add a delete ("destroy") link at the end of the listing table. my HTML is as follows.

<title>All Recipes</title>

<h1>Online Cookbook - All Recipes</h1>
<table border="1">
<td width="40%>

<td width="20%">

<td width="20%>

<td width="20%">


<% @recipes.each do |recipe| %>
<td><%= link_to recipe.title, :action => "show", :id => recipe.id %></td>
<td><%= recipe.category.name %> </td>
<td><%= recipe.date %></td>
<td><%= link_to "Delete", :action => "destroy", :id => recipe.id %></td>
<% end %>

<%= link_to "Create new recipe", :action => "new" %>


I believe I get the correct link but It just reloads the list view. In the original list view when you click destroy it gives you a popup to confirm deletion. What am I missing?

1 to 1 of 1
  1. Homework #1 issues
    2006-09-11 20:58:12  m3_del [View]

    • Homework #1 issues
      2006-09-15 03:54:37  StBob [View]

1 to 1 of 1