문제

I want to print default value for my forms textarea i have bellow code

 textarea(class="form-control",name="details")
     if restaurant.details
          #{restaurant.details}

but if my value ( restaurant.details ) is set it will apears like tag not text, how can print text inside my textarea?

도움이 되었습니까?

해결책

Use the | operator:

 textarea(class="form-control",name="details")
     if restaurant.details
       | #{restaurant.details}

codepen

From the docs

The simplest way of adding plain text to templates is to prefix the line with a | character (pronounced "pipe").

다른 팁

By using !{...} instead of #{...}, you will get string exactly without compilation / interpolation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top