Skip to content

Cannot override data in ajax:beforeSend Event #168

@regis-leray

Description

@regis-leray

I try to send some data with a post ajax request like this and in the server side i dont receive the data (but i do see the value in firebug)

$('a[data-with], a[data-submit]').live('ajax:beforeSend', function(event, xhr, settings) {
      settings.data = "name=John&time=2pm";
});

but if im doing like this it s working

$('a[data-with], a[data-submit]').live('ajax:beforeSend', function(event, xhr, settings) {
      settings.url += "?name=John&time=2pm";
});

My route is configured as a POST method

resources :categories do
      collection do 
        post :addcategory
      end
    end

What im doing wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions