Is there a form to handle Array type?
I generated a scaffold for a model that has Array for a field type.
But the partial form does not handle this type.
How do we tie Array types to forms?
Thanks,
Alex
Is there a form to handle Array type?
I generated a scaffold for a model that has Array for a field type.
But the partial form does not handle this type.
How do we tie Array types to forms?
Thanks,
Alex
What kind of values are you storing in your array? This may be the sort
of thing you need to roll yourself.
Walter
I am storing email addresses.
Have you tried:
serialize :email_addresses, Array
before_save :split_email addresses
def split_email_addresses
email_addresses.split(’ ')
end
Or, just store email addresses in a separate table, and create a
has_many relationship.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs