From: "Matt Aimonetti" <mattaimone...@gmail.com>
Date: Thu, 24 Jan 2008 17:34:54 -0800
Local: Fri 25 Jan 2008 01:34
Subject: Re: Adding a delete confirmation
Remote.DeleteLink = Behavior.create(Remote.Base, { }, this.options); if (confirm('Are you sure?')){ return this._makeRequest(options); }else{ return false; } } }); don't change your route, a delete action should not be a GET but a DELETE. I'm sure my code could be cleaned up by extending Remote.Link but oh well, -Matt On 1/24/08, KJoyner <K...@kjoyner.com> wrote: > I am trying to use Low Pro to add a delete confirmation. In my > def delete > def destroy > @item = Item.find( params[ :id ] ) > redirect_to items_path > In the routes, I add a delete route to items by: > map.resources :items, :member => { :delete => :get } > I then have a view where I add a delete link like this (also using > = link_to "delete", delete_item_path( item ), :class => 'delete' > All of this works when I have javascript disabled. Now I am trying to > Remote.Delete = Behavior.create( Remote.Base, { > Event.addBehavior( { > The onclick gets executed but it is not working correctly. Any help > Thanks, > -- Ken You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||