arrays - Accepting form fields with square brackets in the name in Rails -
in rails app, i've run case i'd have checkbox name ends in square brackets, e.g.:
name="foo[bar][baz[]]"
other special characters seem handled correctly, looks rails stripping out square brackets , treating them declaring array rather being part of name. needs done allow arbitrary characters (brackets in particular) in name , have them processed correctly rails?
that's because square brackets not allowed in specification:
id , name tokens must begin letter ([a-za-z]) , may followed number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), , periods (".").
from html 4 basic html data types
about rails part, , combining these 2 answers (1 , 2):
rails make use of square brackets make associations in params hash, shouldn't mess names.
Comments
Post a Comment