My method :
def clicked(socket, payload) do socket |> Drab.Browser.console("You've sent me this: #{payload |> inspect}") end
The error I get :
Transport: Phoenix.Transports.WebSocket Parameters: %{"event" => "click", "event_handler_function" => "clicked", "payload" => %{"click" => "clickety-click"}, "reply_to" => "8a0affa7-1dd2-4e9d-95d8-9441897eb747"
[error] Drab Handler failed with the following exception: ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: ...
After closing the js pop up I get a callback :
[debug] INCOMING "execjs" on "__drab:same_path:/packs/1" to Drab.Channel Transport: Phoenix.Transports.WebSocketParameters: %{"ok" =>["SFMyNTY.g3QAAAACZAAEZGF0YWgCZ2QADW5vbm9kZUBub2hvc3QAAA6mAAAAAAByAANkAA1ub25vZGVAbm9ob3N0AAAAj__RLAABgxyz62QABnNpZ25lZG4GAAPPMjNfAQ.2KVP7lyR4fOT_q4tZNBGdCA3dzZFZX5fXWMV_gc-Xjg", nil]}
I follow your guide on the demo page : https://tg.pl/drab/nojquery (by the way the demo page doesn't work either)
My button :
<a class="waves-effect waves-light btn grey" onclick="Drab.run_handler('click', 'clicked', {click: 'clickety-click'});">
My method :
def clicked(socket, payload) do socket |> Drab.Browser.console("You've sent me this: #{payload |> inspect}") end
The error I get :
Transport: Phoenix.Transports.WebSocket Parameters: %{"event" => "click", "event_handler_function" => "clicked", "payload" => %{"click" => "clickety-click"}, "reply_to" => "8a0affa7-1dd2-4e9d-95d8-9441897eb747"
[error] Drab Handler failed with the following exception: ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: ...
After closing the js pop up I get a callback :
[debug] INCOMING "execjs" on "__drab:same_path:/packs/1" to Drab.Channel Transport: Phoenix.Transports.WebSocket
Parameters: %{"ok" =>["SFMyNTY.g3QAAAACZAAEZGF0YWgCZ2QADW5vbm9kZUBub2hvc3QAAA6mAAAAAAByAANkAA1ub25vZGVAbm9ob3N0AAAAj__RLAABgxyz62QABnNpZ25lZG4GAAPPMjNfAQ.2KVP7lyR4fOT_q4tZNBGdCA3dzZFZX5fXWMV_gc-Xjg", nil]}