Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题:不是从我的 ERB 模板获取转换后的输出,而是有一个参数、设置或 hack 我可以使用来输出在转换运行之前生成的原始 ruby 代码吗?
理由:我无法找出 ERB 模板语法错误的问题,我想查看由 ERB 生成的普通 ruby 代码。如果其他人有任何替代方法来调试和跟踪 ERB 中的特定问题,请加入。
TIA
您可以通过 debug(@object) 获取有关您正在使用的对象的信息。这可能有助于准确了解您正在使用什么以及您可以使用它做什么。