gpt4 book ai didi

ruby-on-rails - 使用 haml 以 formattastic 添加标签/提示的链接

转载 作者:行者123 更新时间:2023-12-03 00:42:46 26 4
gpt4 key购买 nike

我正在尝试使用 haml 以格式添加一个到复选框的链接。看起来 formattastic 在解析标签或提示时会从文本中删除所有 ruby​​/haml/html 语法。

也就是说,这不起作用:

= f.input :terms, label: '=link_to \'Here\', path_to_link', hint: '=link_to \'Other Place\', path_to_other_link', as: :boolean

除了在此输入之外编写另一个 div 之外,还有什么可以做的吗?或者我对这一切都错了?我是一个 Rails/Haml/Formtastic 菜鸟。

最佳答案

如果您使用 ' 进行字符串引用,则基本上是在告诉 ruby​​ 不要解析该内容。

尝试这样的事情:

= f.input :terms, label: link_to('Here', path_to_link), hint: link_to('Other place', path_to_other_link), as: :boolean

关于ruby-on-rails - 使用 haml 以 formattastic 添加标签/提示的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7854560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com