Greetings,
I would like to generate a link with the link helper that includes a value from the current connection. The result would show “Sign Out nickname” where nickname is resolved from the assign fields. I’m using Pow library, but I think it’s a general question. In Pow, I have access to the current user as @current_user
and can find the nickname as @current_user.nickname
. I’ve tried just using the macro directly in the link text like this:
<span class="menu-link"><%= link "Sign Out @current_user.nickname"), to: Routes.pow_session_path(@conn, :delete), method: :delete %></span>
And also with some embedded evaluation, which has a syntax error.
<span class="menu-link"><%= link EEx.eval_string("Sign Out <%= @current_user %>"), to: Routes.pow_session_path(@conn, :delete), method: :delete %></span>
Can someone kindly put me on the right track to evaluating such expressions? Thanks!