From: KJoyner <K...@kjoyner.com>
Date: Fri, 25 Jan 2008 16:57:35 -0800 (PST)
Local: Sat 26 Jan 2008 00:57
Subject: Re: Adding a delete confirmation
I changed the auth code as follows but cannot figure out any way to
furthur simplify. var AJ =
authenticity_token_query_parameter_for_page:function()
}
I also moved to event delegation instead of trying to make the reload
work. The javascript now looks as follows: Remote.Delete = Behavior.create( Remote.Base,
this._makeRequest( options );
});
Event.addBehavior(
{ '#item_list' : Remote.Delete });
Notice, that this attaches a behavior to a div with an ID of
item_list. If the element that received the click has a classname of delete_link, then a confirmation will be displayed and the element deleted through the destroy method. On 25 Jan, 00:25, Jarkko Laine <jar...@jlaine.net> wrote:
> On 25.1.2008, at 9.20, KJoyner wrote:
> > I have added the following that now works, except for the reload which
> > var AJ =
> Can't answer to your reload question off the top of my head, but you
> > document.body.select( 'input[ name = "authenticity_token" ]' )
> This is also same as $$('input[name="authenticity_token']).first() (http://prototypejs.org/api/utility/dollar-dollar
> --
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.
| ||||||||||||||