开发者

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

开发者 https://www.devze.com 2023-02-06 22:12 出处:网络
With a hidden element, you reference the ID to get the posted value, what is name for then?开发者_如何学C

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

精彩评论

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