I'm using a form_for to create new Records. Each record has a main photo url :photo and three optional photo urls that I'm storing in a serialized array, other_photos.
In my form, I want to give the user an option to add up to three additional photo urls, which would be stored in other_photos[0], other_photos[1], and other_photos[2]
I added the column to the database, added serialize :other_photos, Array to the model, and permitted the strong params :other_photos => []
How do I handle this in my form? Right now, I have this for my main photo:
<%= form_for @record do |r| %>
...
<%= label_tag :name, "IMAGE URL:", class: "login-label" %>
<%= r.text_field :photo, size: 50 %>
How do I set the params for other_photos? This doesn't work:
<%= r.text_field :other_photos[0], size: 50 %>