title: Handling an undefined variable
body: <p>I render a partial in one view:</p>
  
  <pre><code>&lt;%= render 'video', :video =&gt; @video, :video_id =&gt; 'video_show_id' %&gt;
  </code></pre>
  
  <p>and have this code in the partial:</p>
  
  <pre><code>&lt;% if video_id %&gt;
    &lt;%= link_to "video", video.video_url, :class =&gt; "oembed", :id =&gt; video_id %&gt;
  &lt;% else %&gt;
    &lt;%= link_to "video", video.video_url, :class =&gt; "oembed" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The problem is that this partial gets rendered in a number of places in my app, and in those other views I do not want to pass <code>:video_id</code> into the partial. Therefore my app throws an error that <code>video_id</code> is undefined. I could pass <code>:video_id =&gt; ""</code> into the partial in the other views, but since the partial is rendered in many places, that is kind of a pain. Is there a simpler way to handle this?</p>