Packages
ex_debug_toolbar
0.1.17
A debug web toolbar for Phoenix projects to display all sorts of information about request
Current section
Files
Jump to
Current section
Files
web/channels/toolbar_channel.ex
defmodule ExDebugToolbar.ToolbarChannel do
use Phoenix.Channel
alias ExDebugToolbar.Toolbar
alias ExDebugToolbar.ToolbarView
alias Phoenix.View
def join("toolbar:request", %{"id" => request_id}, socket) do
case Toolbar.get_request(request_id) do
{:ok, request} ->
payload = %{
html: View.render_to_string(ToolbarView, "show.html", [request: request]),
request: request
}
{:ok, payload, socket}
{:error, reason} ->
{:error, %{reason: reason}}
end
end
end