Zia Isam Zia Isam - 4 months ago 18x
CSS Question

How to concat haml variable with img src string

I have haml loop with CSS class

, inside for loop I just wanna concat src string with for loop index.

%img.thumbnail{src=> 'string'i}


Your haml syntax is wrong, check this simple loop with img src string injection.

- (1..3).each do |i|
    %img.thumbnail{:src => "string#{i}"}

you have missed : and wrong variable syntax i it should be #{i}.

try this way and comment me.