PhoenixActiveLink

Phoenix helper to create links with "active" state.

Installation

Add phoenix_active_link to your list of dependencies in mix.exs:

def deps do
[{:phoenix_active_link, "~> 0.0.1"}]
end

Usage

Here is a sample usage.

<header>
<ul>
<%= active_link(@conn, "Dashboard", to: "/", active: [{Dashboard, :index}], wrap_tag: :li) %>
<%= active_link(@conn, "Users", to: "/users", wrap_tag: :li) %>
</ul>
</header>

For more information, take a look at the documentation.