title: Controlling the existence of an attribute
body: <p>I have a problem with the <a href="http://rdoc.info/gems/slim/frames" rel="noreferrer"><code>Slim</code></a> template engine in a <code>Sinatra</code> project. I have an edit form to be filled when the route is triggered. There is an issue with <code>HTML select option</code>. I need something like this when the edit form is loaded. Notice that <code>Mrs.</code> option is <code>selected</code>:</p>
  
  <pre><code>&lt;select name="person[title]" id="person[title]"&gt;
    &lt;option value="Mr."&gt;Mr.&lt;/option&gt;
    &lt;option value="Mrs." selected&gt;Mrs.&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>option[value="Mrs." "#{person.title == :mrs ? 'selected' : ''}"]
  </code></pre>
  
  <p>The exception was about an attribute error. Then I tried something like this:</p>
  
  <pre><code>option[value="Mrs." selected="#{person.title == :mrs ? true : false}"]
  </code></pre>
  
  <p>but then the output was something like this:</p>
  
  <pre><code>&lt;option value"Mrs." selected="false"&gt;Mrs.&lt;/option&gt;
  </code></pre>
  
  <p>I guess the string<code>"false"</code> is interpreted as <code>true</code>. That failed. I tried some combinations with round brackets but couldn't get it to work.</p>
  
  <p>How could I set the <code>selected</code> attribute of an <code>option</code> in a <code>select</code> list in <code>Slim</code>?</p>