So I'm building an app where users are filling out a form. I would like one of answers to a form question to be a gallery of images that the user can select to answer that particular question. Something like the Image Picker gem.
<select class="image-picker show-labels show-html">
<option data-img-src="http://placekitten.com/220/200" value="1">Cute Kitten 1</option>
<option data-img-src="http://placekitten.com/180/200" value="2">Cute Kitten 2</option>
<option data-img-src="http://placekitten.com/130/200" value="3">Cute Kitten 3</option>
<option data-img-src="http://placekitten.com/270/200" value="4">Cute Kitten 4</option>
</select>
I have two problems with this potential solution.
I'd like to show the name of the image on the Show and Index pages, not the integer value. Is there a way to pass the description instead of the integer in this case? I can build a model and use collection_select and then call the name method, but then how do I enter the image url into a model so it gets called and displayed properly like in the HTML above?
I have something like 200 images I want to do this with. Is there an easier way to make this happen or do I need to manually enter each entry into a model from the console?
Thanks!