title: Iterating over JSON objects with HAML Partial
body: <p>I am relatively new to ruby on rails and haml. I want to get the name from my JSON object in haml. </p>
  
  <p>I have this in my .rb file</p>
  
  <pre><code>campaigns = '[{"name":"Campaign_1"},{"name":"Campaign_2"},{"name":"Campaign_3"}]'
  render "evaluate" , :locals =&gt; {:campaigns =&gt; campaigns}
  </code></pre>
  
  <p>I want to print out "Campaign_1", "Campaign_2" ... from the name. This is what I have in my haml file. I have tried several variations of this for loop but none have quite worked. This is my latest one. </p>
  
  <p>This is what I have in my haml file:</p>
  
  <pre><code>- for campaign in @campaigns
          %input{:type =&gt; "checkbox"}
            - campaign.name
  </code></pre>
  
  <p>This gives me </p>
  
  <pre><code>undefined method `each' for nil:NilClass` 
  </code></pre>
  
  <p>Any help would be appreciated. Thank you!</p>
  
  <p><strong>Important Note:</strong>
  This haml file is a partial</p>