开发者

With a hidden element, you reference the ID to get the posted value, what is name for then?

With a hidden element, you reference the ID to get the posted value, what is name for then?

开发者_如何学C

Just wondering, do I even have to add that attribute in the HTML?


With any form element, including hidden type ones, only the name of the element is used to name the posted value.

You have to add the name attribute.


If you have

hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@'

in your view, you'll access the value in your controller with

params[:token]

Is that what you're asking?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜