title: How do I defined a variable link_to to an external URL
body: <p>On my site a user has a personal profile with a link to his personal external website. The url of the sites I store in a postgresql database under the name <strong>website</strong>. When I test the result, I always get a url like this:</p>
  
  <pre><code>http://localhost:3000/www.example.com
  </code></pre>
  
  <p>instead of <code>http://www.example.com</code></p>
  
  <p>My view <strong>index.html.erb</strong> looks like this:</p>
  
  <pre><code>&lt;% provide(:title, 'All projects') %&gt;
  &lt;h1&gt;All projects&lt;/h1&gt;
  
  &lt;%= will_paginate %&gt;
  
  &lt;ul class="microposts"&gt;
      &lt;%= render @microposts %&gt;
  &lt;/ul&gt;
  
  &lt;%= will_paginate %&gt;
  </code></pre>
  
  <p>and my <strong>_micropost.html.erb</strong> like this:</p>
  
  <pre><code>&lt;li&gt;
      &lt;span class="title"&gt;&lt;%= micropost.title %&gt;&lt;/span&gt;
      &lt;span class="website"&gt;&lt;%= link_to micropost.website, micropost.website %&gt;&lt;/span&gt;
      &lt;span class="content"&gt;&lt;%= micropost.content %&gt;&lt;/span&gt;
      &lt;span class="timestamp"&gt;
          Posted &lt;%= time_ago_in_words(micropost.created_at) %&gt; ago.
      &lt;/span&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>I don't know what's the problem in this case. If I set a @ before <strong>micropost.website</strong> it gives me an error <strong>undefined method `website' for nil:NilClass</strong></p>
  
  <p>Does anyone can help me (I'm a RoR beginner)?</p>
  
  <p>KR, Fabian</p>