| |
Low Pro |
Jarkko is correct, I am trying to create both an accessible link (when
After reading your post, I just thought to check my log to see if it
On 24 Jan, 21:40, Jarkko Laine <jar...@jlaine.net> wrote:
> > Remote.DeleteLink = Behavior.create(Remote.Base, {
> > don't change your route, a delete action should not be a GET but a
> I think he's using the delete action (note the name) as an
> > On 1/24/08, KJoyner <K...@kjoyner.com> wrote:
> > Event.addBehavior( {
> > The onclick gets executed but it is not working correctly. Any help
> So what happens? Does the request get to Rails? Have you used Firebug
> --
Javascript is disabled) and an AJAX request when java is enabled.
showed anything. It does route but shows an
ActionController::InvalidAuthenticityToken during a call to
request_forgery_protection.
> > onclick : function() {
> > var options = Object.extend({ url : this.element.href, method :
> > 'delete' }, this.options);
> > if (confirm('Are you sure?')){
> > return this._makeRequest(options);
> > }else{
> > return false;
> > }
> > }
> > });
> > DELETE.
> intermediary action to hold a form with DELETE method pointing to the
> _destroy_ action that actually deletes the record. That's pretty much
> the only way to use an accessible link to perform a destructive action
> afaik.
> > <snip>
> > Remote.Delete = Behavior.create( Remote.Base, {
> > onclick: function( event ) {
> > if ( confirm( 'Are you sure?' ) ) {
> > var destroy_url = this.element.href.gsub ( '/delete$', '' );
> > options = Object.extend( { url: destroy_url, method: 'delete' },
> > this.options );
> > return this._makeRequest( options )
> > }
> > return false;
> > }
> > });
> > '.delete' : Remote.Delete
> > });
> > would be appriciated.
> to debug what happens inside the behaviour (e.g. what does options
> look like when you make the request)?
> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....