title: Rendering img in an eex template: protocol Phoenix.HTML.Safe not implemented
body: <p>I have a project display page that displays text correctly:</p>
  <pre><code>&lt;p&gt;&lt;%= @post.body %&gt;&lt;/p&gt;
  
  &lt;%= @post.title %&gt;&lt;/h1&gt;
  </code></pre>
  <p>I want to display a user uploaded pic.</p>
  <p>I tried:</p>
  <pre><code>&lt;img src=&quot;&lt;%= @post.project_pic %&gt;&quot;/&gt;
  </code></pre>
  <p>which returns:</p>
  <pre><code>protocol Phoenix.HTML.Safe not implemented for %{file_name: &quot;pexels-photo-144322 (1).jpeg&quot;, updated_at: #Ecto.DateTime&lt;2017-08-06 14:05:26&gt;}
  </code></pre>
  <p>This shows me the pic has uploaded and is stored in the database.</p>
  <p>I added inspect:</p>
  <pre><code> &lt;img src=&quot;&lt;%= inspect @post.project_pic %&gt;&quot;/&gt;
  </code></pre>
  <p>as per this answer:</p>
  <p><a href="https://stackoverflow.com/questions/40971719/protocol-phoenix-html-safe-not-implemented-elixir-phoenix">protocol Phoenix.HTML.Safe not implemented Elixir Phoenix</a></p>
  <p>Which passes the compiler, but only displays a broken image icon.</p>
  <p><strong>How is the pic stored?</strong></p>
  <p>I have this in post.ex:</p>
  <pre><code>field :project_pic, Citybuilder.ProjectPic.Type  
  </code></pre>
  <p>in stories.ex I have:</p>
  <pre><code>|&gt; cast_attachments(attrs, [:project_pic])
  </code></pre>
  <p>in the latest migration file it's stored as a string:</p>
  <pre><code> add :project_pic, :string
  </code></pre>
  <p>Maybe that's the error.</p>
  <p>I'm not sure if the error is in my eex syntax, or somewhere deeper in the file structure.</p>