you're trying to assign hashes { :key => value} in array syntax 

[[:name=> "text"]] vs [{:name => "text"}]

try to instantiate your array variable in an irb console and you'll see the 
issue. 


On Thursday, February 4, 2016 at 3:07:34 PM UTC-6, William Reithmeyer wrote:
>
> - array = [[:name => "Hogan's Heros", :url => "
> http://www.gstatic.com/tv/thumb/tvbanners/184204/p184204_b_v8_ac.jpg"; ], 
> [:name => "Get Smart", :url => "
> http://www.gstatic.com/tv/thumb/movieposters/176339/p176339_p_v8_af.jpg"; 
> ], [:name => "Hawaii Five-0", :url => "
> http://www.gstatic.com/tv/thumb/tvbanners/8130405/p8130405_b_v8_aj.jpg"; ], 
> [:name => "The Big Lebowski", url => "
> http://t3.gstatic.com/images?q=tbn:ANd9GcRBYp315X-0pNvI-Dvqj8FR0AGdF39VCprXpurd0cQel__e17CP
> " ]]
> -array.each do |movie|
>     .img{ :style => "background-image: url('#{movie['url']}');" }
>     .name #{movie['name']}
>
> I looked everywhere online, can't find anything.
> Why am i getting an error for having this array and the each loop?
>
> > HAML compilation of haml/index.html.haml failed!
> > [#] Error: undefined local variable or method `url' for 
> #<Object:0x000000049b6140>
> even when I change it to :url instead of 'url' I get the same problem.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haml+unsubscr...@googlegroups.com.
To post to this group, send email to haml@googlegroups.com.
Visit this group at https://groups.google.com/group/haml.
For more options, visit https://groups.google.com/d/optout.

Reply via email to