defmodule Appointments.LayoutView do
  use Appointments.Web, :view

  def active?(conn, path) do
    [_ | [resource | _]] = String.split(conn.request_path, "/")
    if resource == path, do: "active", else: ''
  end
end

defmodule Appointments.LayoutView do
  use Appointments.Web, :view

  def active?(conn, path) do
    resource = String.split(conn.request_path, "/") |> Enum.at(1)
    if resource == path, do: "active", else: ""
  end
end

Make active? a bit prettier
Make active? a bit prettier

sveittir-finnar/book-me,sveittu-finnarnir/book-me,sveittir-finnar/book-me,sveittu-finnarnir/book-me