-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
I have a model with a type hash constant:
class Model < Granite::ORM::Base
extend Query::BuilderMethods
VALID_TYPES = {
:one => 1,
:two => 2
}
endWhere the key of VALID_TYPES represents the human readable version of the mapping and the value represents what is stored in the database.
Using this in a form with select_field like this:
== form action: "/model/new", method: :post do
== csrf_tag
.form_group
== select_field name: :type, collection: Model::VALID_TYPESI get a somewhat unexpected result:
<select class="monitor_type" id="monitor_type" name="monitor_type">
<option value="one">1</option>
<option value="two">2</option>
</select>Am I missing something obvious, or is this backwards?
Reactions are currently unavailable