render an actual table in the readme

This commit is contained in:
Louis-Michel Couture 2017-06-19 16:57:06 -04:00 committed by GitHub
parent 5b43d10a08
commit 37fa78b949
1 changed files with 25 additions and 25 deletions

View File

@ -541,31 +541,31 @@ The following table shows the html element you will get for each attribute
according to its database definition. These defaults can be changed by according to its database definition. These defaults can be changed by
specifying the helper method in the column `Mapping` as the `as:` option. specifying the helper method in the column `Mapping` as the `as:` option.
Mapping | Generated HTML Element | Database Column Type Mapping | Generated HTML Element | Database Column Type
--------------- |:-------------------------------------|:-------------------- --------------- |--------------------------------------|---------------------
`boolean` | `input[type=checkbox]` | `boolean` `boolean` | `input[type=checkbox]` | `boolean`
`string` | `input[type=text]` | `string` `string` | `input[type=text]` | `string`
`email` | `input[type=email]` | `string` with `name =~ /email/` `email` | `input[type=email]` | `string` with `name =~ /email/`
`url` | `input[type=url]` | `string` with `name =~ /url/` `url` | `input[type=url]` | `string` with `name =~ /url/`
`tel` | `input[type=tel]` | `string` with `name =~ /phone/` `tel` | `input[type=tel]` | `string` with `name =~ /phone/`
`password` | `input[type=password]` | `string` with `name =~ /password/` `password` | `input[type=password]` | `string` with `name =~ /password/`
`search` | `input[type=search]` | - `search` | `input[type=search]` | -
`uuid` | `input[type=text]` | `uuid` `uuid` | `input[type=text]` | `uuid`
`text` | `textarea` | `text` `text` | `textarea` | `text`
`file` | `input[type=file]` | `string` responding to file methods `file` | `input[type=file]` | `string` responding to file methods
`hidden` | `input[type=hidden]` | - `hidden` | `input[type=hidden]` | -
`integer` | `input[type=number]` | `integer` `integer` | `input[type=number]` | `integer`
`float` | `input[type=number]` | `float` `float` | `input[type=number]` | `float`
`decimal` | `input[type=number]` | `decimal` `decimal` | `input[type=number]` | `decimal`
`range` | `input[type=range]` | - `range` | `input[type=range]` | -
`datetime` | `datetime select` | `datetime/timestamp` `datetime` | `datetime select` | `datetime/timestamp`
`date` | `date select` | `date` `date` | `date select` | `date`
`time` | `time select` | `time` `time` | `time select` | `time`
`select` | `select` | `belongs_to`/`has_many`/`has_and_belongs_to_many` associations `select` | `select` | `belongs_to`/`has_many`/`has_and_belongs_to_many` associations
`radio_buttons` | collection of `input[type=radio]` | `belongs_to` associations `radio_buttons` | collection of `input[type=radio]` | `belongs_to` associations
`check_boxes` | collection of `input[type=checkbox]` | `has_many`/`has_and_belongs_to_many` associations `check_boxes` | collection of `input[type=checkbox]` | `has_many`/`has_and_belongs_to_many` associations
`country` | `select` (countries as options) | `string` with `name =~ /country/` `country` | `select` (countries as options) | `string` with `name =~ /country/`
`time_zone` | `select` (timezones as options) | `string` with `name =~ /time_zone/` `time_zone` | `select` (timezones as options) | `string` with `name =~ /time_zone/`
## Custom inputs ## Custom inputs