docs/customizing_attribute_partials.md in administrate-0.8.1 vs docs/customizing_attribute_partials.md in administrate-0.9.0

- old
+ new

@@ -1,9 +1,22 @@ # Customizing attribute partials Occasionally you might want to change how specific types of attributes appear -across all dashboards. +across all dashboards. You can customize the following built in field types: + +- `belongs_to` +- `boolean` +- `date_time` +- `email` +- `has_many` +- `has_one` +- `number` +- `polymporphic` +- `select` +- `string` +- `text` + For example, you might want all `Number` values to round to three decimal points. To get started, run the appropriate rails generator: ```bash @@ -13,9 +26,15 @@ This will generate three files: - `app/view/fields/number/_form.html.erb` - `app/view/fields/number/_index.html.erb` - `app/view/fields/number/_show.html.erb` + +You can generate the partials for all field types by passing `all` to the generator. + +```bash +rails generate administrate:views:field all +``` The generated templates will have documentation describing which variables are in scope. The rendering part of the partial will look like: