我正在使用best_in_place宝石进行原位编辑。我周围有一个我想要编辑的链接,但是显示给用户的应该是“编辑链接”。我希望能够在单击该字段时编辑该链接,但是我希望显示给用户的内容(锚文本)作为“编辑链接”。我尝试使用“ display_with”和“ value”,但是都没有用。
当前正在显示数据库字段的值,该值是URL:https : //plus.google.com/+SteveQuatrani/posts
<%= best_in_place c, :google_maps_url, value: "Edit Link" %>
有没有办法做到这一点?预先感谢您的帮助!
display_with需要帮助程序或proc,因此请尝试给它一个:
<%= best_in_place c, :google_maps_url, display_with: Proc.new {"Edit Link"} %>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句