title: put ruby code into html string? Sinatra, Ruby
body: <p>I'm using Sinatra.
  I have a deck: in main.rb</p>
  
  <pre><code>session[:deck] = []
  suit  = ['Clubs', 'Spades', 'Hearts', 'Diamonds']
  values = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen','King', 'Ace']
  session[:deck] = suit.product(values).shuffle!
  </code></pre>
  
  <p>In my game.erb I want to display the images associated with each of these arrays. I have all the images in my public/images/cards. In the game.erb I can get any card to display statically like so:</p>
  
  <pre><code>Here are your cards: &lt;img src="/images/cards/clubs_10.jpg" height="120" width="120"&gt;
  </code></pre>
  
  <p>Is there a way I can do something like:</p>
  
  <pre><code>&lt;img src='/images/cards/session[:deck].first_session[:deck].last.jpg' height="120" width="120&gt;
  </code></pre>
  
  <p>I want to make a helper method, but I can't seem to get started.</p>