View Source Exzeitable.HTML.ActionButton (Exzeitable v0.6.4)

For the actions buttons such as :new, :edit etc, as well as custom buttons.

Custom buttons can be added to the list in :action_buttons

Example

  action_buttons: [:new, :edit, :super_cool_custom_action]

You can then define the function called for that action in the module where the table is defined. Don't forget to add your csrf_token.

  def super_cool_custom_action(socket, item, csrf_token) do
    link "SUPER AWESOME", to: Routes.super_cool_path(socket, :custom_action, item), "data-confirm": "Are you sure?", csrf_token: csrf_token
  end

Summary

Types

Controller action

Functions

Builds an individual button, takes an atom representing the action, and the assigns map

Gets the parent that the nested resource belongs to

Types

@type action() :: :new | :delete | :show | :edit

Controller action

@type assigns() :: %{
  socket: Phoenix.LiveView.Socket.t(),
  params: Exzeitable.Params.t()
}

Functions

@spec build(:new, assigns()) :: {:safe, iolist()}

Builds an individual button, takes an atom representing the action, and the assigns map

Link to this function

parent_for(entry, params)

View Source
@spec parent_for(
  struct(),
  Exzeitable.Params.t()
) :: struct()

Gets the parent that the nested resource belongs to