Skip to content
On this page

Markdown

Trix field

The Markdown field renders a SimpleMDE Markdown Editor and is associated with a text or textarea column in the database. Markdown field converts text within the editor into raw Markdown text and stores it back in the database.

The Markdown field is hidden from the Index view.

ruby
field :description, as: :markdown

Options

always_show

By default, the content of the Markdown field is not visible on the Show view, instead, it's hidden under a Show Content link that, when clicked, displays the content. You can set Markdown to always display the content by setting always_show to true.

Default

false

Possible values

true, false

height

Sets the value of the editor

Default

auto

Possible values

auto or any number in pixels.

spell_checker

Toggles the editor's spell checker option.

ruby
field :description, as: :markdown, spell_checker: true

Default

false

Possible values

true, false

Enable spell checker