I’ve been putting options for select lists in my models but I haven’t been able to do this with option/value pairs Anyone know how? The code below doesn’t work
I've been putting options for select lists in my models but I haven't been able to do this with option/value pairs Anyone know how? The code below doesn't work
When this validator runs, what is it comparing? The label or the value? You are passing a combination of the two into your validator and expecting it to guess. You could try either using a hash for the data structure, and being explicit about what you want it to compare:
Please google "Ruby symbol to Proc" to better understand how that last one works. If you use the first approach, then you will need to change the way you access the constant's values in your select list constructor.