In the controller documentation for plugins, there's a section that talks about routing to specific actions using a Craft
object like this:
var url = Craft.getActionUrl('cocktailRecipes/ingredients/saveIngredient', { id: 10 });
I think this object is the one in /craft/app/resources/js/craft.js
, but I can't figure out how to make it available. I tried including it via includeJsResource
, but this doesn't appear to be working
{% includeJsResource "resources/js/craft.js" %}
What do I need to include to be able to use this object in my JavaScript (it is not a load ordering issue, the URL generated by includeJsResource goes to the 404 page)?