---
area: "Changes"
parent: "Changes"
url: "https://unpoly.com/changes/0.18.0"
released: "2016-02-09"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [Changes](https://unpoly.com/changes.md)</nav>

# Version 0.18.0

Released on February 09, 2016 with [19 commits](https://github.com/unpoly/unpoly/commits/v0.18.0)

## Compatible changes {#compatible-changes}

- New UJS attribute [`[up-toggle]`](https://unpoly.com/up-toggle) to show or hide part of a form if certain options are selected or boxes are checked.
- Links can now have an optional `up-confirm` attribute. This opens a confirmation dialog with the given message before the link is followed or the modal/popup is opened.
- New function [`up.off()`](https://unpoly.com/api/up.off.md). This unregisters an event listener previously bound with [`up.on()`](https://unpoly.com/api/up.on.md).
- If a container contains more than one link, you can now set the value of the [`up-expand`](https://unpoly.com/api/up-expand.md) attribute to a CSS selector to define which link should be expanded.
- You can now configure a list of safe HTTP methods in [`up.proxy.config.safeMethods`](https://unpoly.com/up.proxy.config). The proxy cache will only cache safe requests and will clear the entire cache after a unsafe request.
- Loading modals and popups will now open if there is a fragment update between the modal/popup's request and response.
- [`up.follow()`](https://unpoly.com/api/up.follow.md) and [`up.replace()`](https://unpoly.com/api/up.replace.md) now have an option `{ failTarget }`. Use it to define the selector to replace if the server responds with an error.
- [`[up-target]`](https://unpoly.com/api/up-follow.md#up-target) and [`[up-follow]`](https://unpoly.com/api/up-follow.md) now have a modifying attribute `[up-fail-target]`. Use it to define the selector to replace if the server responds with an error.
- New utility method [`up.util.reject()`](https://unpoly.com/api/up.util.reject.md)
- New utility method [`up.util.only()`](https://unpoly.com/api/up.util.only.md)
- New utility method [`up.util.except()`](https://unpoly.com/api/up.util.except.md)
- Fix a bug where modals could no longer be opened on some browsers
- When preventing an event emitted by an async function, that function now rejects its promise.
- Async functions that encounter an error now prefer to reject promises with an [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object (instead of a string with the error message)

## Breaking changes {#breaking-changes}

- ⚠️ 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](https://makandracards.com/makandra/38347).

  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`](https://unpoly.com/up.proxy.config) and [`up.proxy.config.wrapMethodParam`](https://unpoly.com/up.proxy.config).

- ⚠️ The requested selector is now sent to the server as a request header [`X-Up-Target`](https://unpoly.com/api/X-Up-Target.md) (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`).

