HAML: Create container/wrapper element only if condition is true

前端 未结 4 726
礼貌的吻别
礼貌的吻别 2021-01-02 04:01

Longshot, but I\'m wondering if there\'s any way to do something like this:

%p # ONLY SHOW THIS IF LOCAL VARIABLE show_paras IS TRUE
  = name
4条回答
  •  余生分开走
    2021-01-02 04:20

    - haml_tag_if show_paras, :p do
      = name
    

    https://github.com/haml/haml/commit/66a8ee080a9fb82907618227e88ce5c2c969e9d1

提交回复
热议问题