ruby on rails 4 - Dynamically create attr_accessor? -
i implementing advanced search form in fields added dynamically. have product belongs_to
pharmacy belongs_to
network.
i want user able add more networks form example if wants search products 2 different networks.
any tips on how dynamically create field? in mind should implement sort of attr_accessor
created user press +
in view. don't think possible.
thanks suggestions!
you should never create accessors based on user input.
instead add in form array-like fields (i.e. field[]
) or hash-like (i.e. field[1]
)
Comments
Post a Comment