Clik a eliminatr y no elimina

Buenas, ya casi estoy terminando mi web de proyectos, donde se puede dar
de alta clientes-proyectos-anotaciones.
Lo que me esta sucediendo es lo siguiente, seleciono un proyecto el cual
puede o no tener notas asociadas y clikeo eliminar. El resultado no me
ayuda, por que no da error, solo vuelve a la pagina donde estaba parado,
la lista de proyectos y no elimina nada, ni en la pagina ni en la DB.
Aqui describo el metodo, es correcto?

def destroy
Item.find(params[:id]).destroy
redirect_to :action => ‘list’
end

PD: la misma corre sobre Windows, no Unix, aclaro por que escuche que
varian algunas cosas.

Saludos y muchas gracias

Mauro

Que te muestra el log? Aunque no de error sirve la info que hay ahi.

2008/8/6 Mauro C. [email protected]

Juan P. wrote:

Que te muestra el log? Aunque no de error sirve la info que hay ahi.

2008/8/6 Mauro C. [email protected]


e[4;36;1mCategory Load (0.000000)e[0m e[0;1mSELECT * FROM categories
WHERE (categories.id = 12) e[0m
DEPRECATION WARNING: link_to_image is deprecated and will be removed
from Rails 2.0 (use link_to(image_tag(…), url)) See
Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. for details. (called from
_run_rhtml_47app47views47items47_list_stripes46rhtml at
c:/ror/todo/public/…/config/…/app/views/items/_list_stripes.rhtml:19)
DEPRECATION WARNING: link_to_image is deprecated and will be removed
from Rails 2.0 (use link_to(image_tag(…), url)) See
Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. for details. (called from
_run_rhtml_47app47views47items47_list_stripes46rhtml at
c:/ror/todo/public/…/config/…/app/views/items/_list_stripes.rhtml:21)
Rendered items/_list_stripes (0.03000)


que si no me equivoco hace referencia a estas lineas

<td><%= link_to_image("edit", { :controller => 'items', :action => 

“edit”, :id =>
list_stripes.id }) %>
<%= link_to_image(“delete”, { :controller => ‘items’, :action =>
“destroy”,
:id => list_stripes.id }, :confirm => “Are you sure you want to delete
this item?”)
%>

Mauro C.
escribió:> seleciono un proyecto el cual puede o no tener notas asociadas y clikeo eliminar.

Mmm… verificaste que esos datos en particular no estén relacionados a
otra tabla? recuerda que si en este caso un proyecto puede tener notas,
esas notas estan relacionadas al proyecto a travez de una llave foranea
(proyecto_id o algo similar dentro de la tabla de notas) y el proyecto
en particular no va a poder ser eliminado

Que version de rails usas?

On Wed, Aug 6, 2008 at 3:33 PM, Mauro C. <

Juan P. wrote:

Que version de rails usas?

On Wed, Aug 6, 2008 at 3:33 PM, Mauro C. <


actionmailer (1.3.3)
Service layer for easy email delivery and testing.

actionpack (1.13.3)
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.2.3)
Web service support for Action Pack.

activerecord (1.15.3)
Implements the ActiveRecord pattern for ORM.

activesupport (1.4.2)
Support and utility classes used by the Rails framework.

cgi_multipart_eof_fix (2.1)
Fix an exploitable bug in CGI multipart parsing which affects Ruby
<= 1.8.5 when multipart boundary attribute contains a non-halting
regular expression string.

cmdparse (2.0.2)
Advanced command line parser supporting commands

fxri (0.3.6)
Graphical interface to the RI documentation, with search engine.

fxruby (1.6.6)
FXRuby is the Ruby binding to the FOX GUI toolkit.

gem_plugin (0.2.2)
A plugin system based only on rubygems that uses dependencies only

highline (1.2.7)
HighLine is a high-level command-line IO library.

hpricot (0.4)
a swift, liberal HTML parser with a fantastic library

log4r (1.0.5)
Log4r is a comprehensive and flexible logging library for Ruby.

mongrel (1.0.1)
A small fast HTTP library and server that runs Rails, Camping, Nitro
and Iowa apps.

mysql (2.7.3)
A win32-native build of the MySQL API module for Ruby.

rails (1.2.3)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.7.2)
Ruby based make-like utility.

sources (0.0.1)
This package provides download sources for remote gem installation

win32-clipboard (0.4.1)
A package for interacting with the Windows clipboard

win32-dir (0.3.1)
Extra constants and methods for the Dir class on Windows.

win32-eventlog (0.4.3)
Interface for the MS Windows Event Log.

win32-file (0.5.3)
Extra or redefined methods for the File class on Windows.

win32-file-stat (1.2.3)
A File::Stat class tailored to MS Windows

win32-process (0.5.1)
Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method

win32-sapi (0.1.3)
An interface to the MS SAPI (Sound API) library.

win32-sound (0.4.0)
A package for playing with sound on Windows.

windows-pr (0.6.2)
Windows functions and constants predefined via Win32API


Juan R. wrote:

Mauro C.
escribi�:> seleciono un proyecto el cual puede o no tener notas asociadas y clikeo eliminar.

Mmm… verificaste que esos datos en particular no est�n relacionados a
otra tabla? recuerda que si en este caso un proyecto puede tener notas,
esas notas estan relacionadas al proyecto a travez de una llave foranea
(proyecto_id o algo similar dentro de la tabla de notas) y el proyecto
en particular no va a poder ser eliminado

Si, si, son tres tablas diferentes (Proyectos-Clientes-Notas)

hola mauro yo en lo personal haría el metodo de la siguiente manera
(usando
variables de instancia):

def destroy
@item = Item.find(params[:id])
@item.destroy
redirect_to :action => ‘list’
end

Prueba y me avisas.

Saludos!

El 6 de agosto de 2008 20:55, Mauro C. <
[email protected]> escribió: