I want to reproduce the haml code below by using the haml_tag
method.
= %img { alt:'Hi' , src: 'hi.jpg' }
Can anyone help?
Nah.. I've just realized that. There it goes:
- haml_tag :img, { alt:'Hi' , src: 'hi.jpg' }
Attention to the details of -
instead of =
. haml_tag
method report directly to the haml model.
Easier than I thought. :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.