Get a value of object field inside fields_for loop

霸气de小男生 提交于 2019-12-02 17:55:23

Formtastic adds additional features to the Rails code, but doesn't take away existing functionality so the following should work for you:

rd.object.review_criteria_id

'object' can be used in plain Rails form helpers to access the underlying bound object, and Formtastic honours this convention.

Nazar Hussain

I got it, I can use

rd.object.review_criteria_id

object is the default wrapper object for the fields_for loop.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!