[up-toggle]
to show or hide part of a form if certain options are selected or boxes are checked.up-confirm
attribute. This opens a confirmation dialog with the given message
before the link is followed or the modal/popup is opened.up.off()
. This unregisters an event listener previously bound with up.on()
.up-expand
attribute to a CSS selector to define which link should be expanded.up.proxy.config.safeMethods
.
The proxy cache will only cache safe requests and will clear the entire
cache after a unsafe request.up.follow()
and up.replace()
now have an option { failTarget }
.
Use it to define the selector to replace if the server responds with an error.[up-target]
and [up-follow]
now have a modifying attribute [up-fail-target]
.
Use it to define the selector to replace if the server responds with an error.up.util.reject()
up.util.only()
up.util.except()
Error
object (instead of a string with the error message)By default Unpoly now converts PUT
, PATCH
and DELETE
requests to POST
requests
that carry their original method in a form parameter named _method
.
This is to prevent unexpected redirect behavior.
Web frameworks like Ruby on Rails or Sinatra are aware of the _method
parameter and use
its value as the method for routing.
You can configure this behavior in up.proxy.config.wrapMethods
and up.proxy.config.wrapMethodParam
.
The requested selector is now sent to the server as a request header X-Up-Target
(this used to be X-Up-Selector
). If you are using unpoly-rails
, you can access it
through up.target
(this used to be up.selector
).
If you're upgrading from an older Unpoly version you should load unpoly-migrate.js
to polyfill deprecated APIs.
Changes handled by unpoly-migrate.js
are not considered breaking changes.
See our upgrading guide for details.