AJAX Play框架[重复]

This question already has answers here:
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2012-12-11 06:57:22Z" class="relativetime">7 years ago</span>.</div>
        </div>
    </aside>

Possible Duplicate:
Play! Framework: Best practice to use URLs in separate JavaScript files?

we are able to insert successfully values in database with this code:

$.ajax({type: "POST", url: "@{Receipes.add('nameIng','quantity')}",

but not with the parameters like:

$.ajax({type:

"POST", url: "@{Receipes.add(':nameIng',':quantity')}",
                    data: {nameIng: "Potato", quantity: "2" } });

any clues?

</div>

What you are looking for is the jsAction template tag. In your case, it could be used like this:

var addReceipeAction = #{jsAction @Receipes.add(':nameIng', ':quantity') /};
$.ajax({type: "POST", url: addReceipeAction({nameIng: "Potato", quantity: 2})});