Home How to set src of img tag with variable in haml?
Reply: 1

How to set src of img tag with variable in haml?

Fullstack Dev
1#
Fullstack Dev Published in 2017-12-07 22:42:45Z

I would like to set src of img tag with variable. I tested this variable and checked it in real url. This is what I have done

%img{border: "0", height: "95", :src => "#{data[:photo]}", width: "250"}/

But it doesn't work still now. I am not sure what the problem is. Looking forward your help. Thanks.

Fullstack Dev
2#
Fullstack Dev Reply to 2017-12-07 22:55:53Z

data[:photo] didn't contain http or https I added this and it work well. Thanks.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.350773 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO