Embedding Ruby code in HTML?

前端 未结 3 1987
北恋
北恋 2021-01-17 22:55

In PHP, it is possible to do this:

 \">

Is it possible to embed Rub

相关标签:
3条回答
  • 2021-01-17 23:06

    Rails has something called ERB to do just this sort of thing.

    0 讨论(0)
  • 2021-01-17 23:12

    You will need to use a templating engine like Ruby Templates (ERB). Here's an example. Rails uses ERB so you could easily do this in each of your templates.

    0 讨论(0)
  • 2021-01-17 23:24

    Use HAML for HTML templating, otherwise ERB.

    0 讨论(0)
提交回复
热议问题