Question: i would like to show an image when a user click on a link and, when he clicks again, to hide it. Here some code:

```
<div class="row">
 <div class="col-md-12">
  <img id="c0" src="images/item-1.png">
  <img id="c1" src="images/item-2.png">
 </div>
</div>

<a id="ac1" href="#">Link</a>

$('#c1').hide();
$('#ac1').click(function(){
    $('#c0').hide();
    $('#c1').show();
});

```

It works and its simple. But it doesnt allow to hide the image when someone click again the link.
I would like to know if there is a solution that I can apply to other situations.
Thank you

Answer: 
change:

```
def response
  [200, {}, 'Hello World']
end

```

to:

```
def response
  [200, {}, ['Hello World']]
end

```
The 3rd item in the array returned from `#response` (ie. the `body`) must respond to the `#each` method. Arrays for example, [respond to `#each`](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-each).

From the [Rack specification](http://rack.rubyforge.org/doc/SPEC.html):

> 
> The Body
> 
> 
> The Body must respond to each and must only yield String values. The
>  Body itself should not be an instance of String, as this will break in
>  Ruby 1.9. If the Body responds to close, it will be called after
>  iteration. If the body is replaced by a middleware after action, the
>  original body must be closed first, if it responds to close. If the
>  Body responds to to\_path, it must return a String identifying the
>  location of a file whose contents are identical to that produced by
>  calling each; this may be used by the server as an alternative,
>  possibly more efficient way to transport the response. The Body
>  commonly is an Array of Strings, the application instance itself, or a
>  File-like object.
> 
> 
>