title: Access to the connection or 'assigns' from within a View
body: <p>I am new to Phoenix, coming from RoR. It seems like the views are akin to Rails helpers and the likely place to put helper functions.</p>
  
  <p>If that is true, how do we access the connection or the connection's assigns from within the view?</p>
  
  <p>Here's my example problem. </p>
  
  <p>The app displays a list of all the users. But I only want to show the API token for the user that is currently signed in. So I'm thinking a method in the <code>UserView</code> is appropriate for doing something like this in the template:</p>
  
  <pre><code>&lt;b&gt;&lt;%= first_name(@user) %&gt;&lt;/b&gt; (api_token: &lt;%= display_token(@user) %&gt;)
  </code></pre>
  
  <p>For the helper method in the view, I need to be able to do something like this:</p>
  
  <pre><code>def display_token(user) do
    case conn.assigns.current_user do
      user -&gt; user.api_token
      nil -&gt; ""
      _ -&gt; "hidden"
    end
  end
  </code></pre>
  
  <p>Any insights are appreciated.</p>