method
hidden_field_tag
hidden_field_tag(name, value = nil, options = {})
public
Creates a hidden field.
Takes the same options as text_field_tag
Register or
log in
to add new notes.
jebin -
January 16, 2014
1 thank
Storing array values
I tried to add a array value using hidden_field_tag and access it in jquery. It just returns the flattened version of array. eg:(If i try to store [1,[1,2,3]] in hidden_field_tag , in jquery iam just getting ‘1 1 2 3’) but if i use input field with type=hidden iam getting the correct value. Why is that?
rajeshco -
November 23, 2015 - (v3.2.13)
0 thanks
Rails 3.2.19
As Jebin reported, we are not getting the value in array format when we set the hidden_field_tag with an Array variable, instead it is a String that we are getting.