–
Column Type | How it’s displayed | HTML Element | |
---|---|---|---|
Integers that don’t end with _id | displayed as input fields | <input type="number"> | |
Foreign key integers that do end with _id | displayed as drop-downs | You must have a Rails association defined. (Hot Glue will warn you if it can’t find one.) If your foreign key has a non usual class name, it should be using the `class_name:` in the model definition. | |
UUIDs (as primary key) Works seamlessly for the `id` field to make your primary key a UUID | (primary keys are never displayed) | ||
UUIDs (as foreign key) All UUIDs not named `id` are assumed to be foreign keys and will be treated as associations. | displayed as drop-downs | ||
String (varchar SQL type) | displayed as small input box; | <input type=”text” size=”40″ /> | uses the limit set on the database if set; or 40 characters width if not is set |
Text (text or bigtext, etc) | displayed as large textarea | <textarea cols=”40″ rows=”5″></textarea> | uses the limit / 40 characters per line to determine height of text area, with maximum height of 5 lines |
Float | displayed as input box with a width of 5 spaces | <input type=”text” width=”5″> | |
Datetime | displayed as HTML5 datetime picker | ||
Date | displayed as HTML5 date picker | ||
Time | displayed as HTML5 time picker | ||
Boolean | displayed radio buttons yes/ no | ||
Enum | displayed as a drop-down list (values are defined the enum values on your model) | For Rails 6 see this post. AFAIK, you must specify the enum definition both in your model and also in your database migration for both Rails 6 + Rails 7 |