开发者

rails: pass value of a text field to a helper function

I'm sure this is a basic question... I have a nested form where the nested object contains a text field. There is a link_to_function in the form that calls some javascript. I want to pass the ja开发者_运维问答vascript function the value of a hidden field in the form (image_type_id).

Can I reference this with some ruby or does this need javascript?


Pass this (or this.parent, depending on where your link is on the form) and use jQuery on the Javascript side to get the hidden value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜