Question: I'm using Sinatra.
I have a deck: in main.rb

```
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!

```

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:

```
Here are your cards: <img src="/images/cards/clubs_10.jpg" height="120" width="120">

```

Is there a way I can do something like:

```
<img src='/images/cards/session[:deck].first_session[:deck].last.jpg' height="120" width="120>

```

I want to make a helper method, but I can't seem to get started.

Answer: 
You can create a method in your helpers:

```
def display_image(card)

"<img src='/images/cards/#{card[0]}_#{card[1]}.jpg' height='100' width='100'>"
end

```

Then you would call your method like so:

```
<%= display_image(card) %>

```
```
<img src='/images/cards/<%= "#{session[:deck].first}_#{session[:deck].last} %>.jpg' height="120" width="120>

```

But probably it's better to do:

```
<%= image_tag "cards/#{session[:deck].first}_#{session[:deck].last}.jpg", size: '120' %>

```