Skip to content
On this page

Code

Code field

The Code field generates a code editor using codemirror package. This field is hidden on Index view.

ruby
field :custom_css, as: :code, theme: 'dracula', language: 'css'

Options

theme

Customize the color theme.

Default value

material-darker

Possible values

material-darker, eclipse, or dracula

Preview the themes here: codemirror-themes.

language

Customize the syntax highlighting using the language method.

Default value

javascript

Possible values

css, dockerfile, htmlmixed, javascript, markdown, nginx, php, ruby, sass, shell, sql, vue or xml.