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?
开发者_如何学CJust 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?
精彩评论