--- layout: default nav: attributes > ic-patch-to ---

ic-patch-to - The Patch-To Attribute

Summary

The ic-patch-to attribute binds the default action (see below) of HTML element to a PATCH to the given URL. For example, on a button, when the button is clicked, an AJAX PATCH will be issued to the given URL.

{% include action_common.html %}

Syntax

The value of the attribute should be a valid relative path (e.g. ic-patch-to="/foo/bar").

Dependencies

ic-patch-to implies a dependency on its path, and Intercooler will issue requests for elements whenever it detects an action that the path depends on. See Dependencies for more information.

Example

Here is a simple example, with a span that depends on the updated URL:

  <button ic-patch-to="/target_url">Click Me!</button>

  <span ic-src="/target_url">You haven't clicked yet...</span>
      
You haven't clicked yet...