Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>J03w is right. It looks like it has something to do with the @ variable you're passing to options in the select_tag.</p> <p>I couldn't figure it out but came up with an alternative that worked fine using a ruby each loop to create the select lists options.</p> <pre><code>&lt;ul&gt; &lt;li&gt; &lt;label&gt;Dropdown with search:&lt;/label&gt; &lt;select name="color-search" id="color-search" class="chzn-select"&gt; &lt;% @colorList.shuffle.each do |color| %&gt; &lt;option value="&lt;%= color %&gt;"&gt;&lt;%= color %&gt;&lt;/option&gt; &lt;% end %&gt; &lt;/select&gt; &lt;/li&gt; &lt;li&gt; &lt;label&gt;Dropdown menu:&lt;/label&gt; &lt;select name="colors" id="colors" class="uniform"&gt; &lt;% @colorList.shuffle.each do |color| %&gt; &lt;option value="&lt;%= color %&gt;"&gt;&lt;%= color %&gt;&lt;/option&gt; &lt;% end %&gt; &lt;/select&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I'm gonna keep playing around to see if I can figure out your initial issue but hopefully this helps you to move on to other things in the mean time.</p> <p>UPDATE 1: It looks like middleman doesn't like passing an array to the select_tag's options parameter which is odd because it should work fine. Initially I thought it was the data in the array that was being stored in @colorList but it all checks out.</p> <p>I even tried simplifying it to the example used in the <a href="http://middlemanapp.com/helpers/#toc_5" rel="nofollow">middleman docs</a> but still got the nil String error. I'm stumped.</p> <p>Perhaps an issue with the latest version of middleman (I'm using 3.1.4)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload