Listing Products

NamePrice Actions
Apple
-7840000000008.82
Orange
1.96
Banana
7.84
Label Value
Locale: en-US
Language: en
Audience: Worldwide
Contact: root@example.com
 

Alternatives

The extension AlternativeGetters makes it easy to link to alternative pages.


Verified Routes

Routex is fully compatible with Verified Routes

Type Code Converted to
Auto redirect(socket, url(~p"/"))
Auto redirect(socket, url(~p"/products"))
Auto ~p"/products/1
Fixed ~p"/europe/products/1

Automated Helpers

As alternative routes are generated, the default Phoenix Route Helpers now return values depending on the current 'branch'.

Code Result
Routes.product_show_path(@socket, :show, 2) /products/2
Routes.product_show_url(@socket, :show, 3) https://routex.fly.dev/products/3

Static Helpers

The helpers generated alternative routes always return a route in the associated branch. Below are the helpers to link to a page in branch Europe/Netherlands.

Code Result
Routes.product_show_europe_nl_path(@socket, :show, 2) /europe/nl/producten/2
Routes.product_show_europe_nl_url(@socket, :show, 3) https://routex.fly.dev/europe/nl/producten/3