diff --git a/content/v2.0/actions/formats-and-mime-types.md b/content/v2.0/actions/formats-and-mime-types.md index 51906948..787a1edd 100644 --- a/content/v2.0/actions/formats-and-mime-types.md +++ b/content/v2.0/actions/formats-and-mime-types.md @@ -188,6 +188,7 @@ If you need your actions to work with additional MIME types, you can configure t module Bookshelf class App < Hanami::App + # config.actions.formats.add :html config.actions.formats.add :custom, "application/custom" end end @@ -195,6 +196,8 @@ end This will add the `:custom` format for the `"application/custom"` MIME type and also configure your actions to use this format. +The **first format added will be the default format**, so you likely want to add `:html` or `:json` before any custom formats. + You can also configure a format to map to multiple MIME types: ```ruby diff --git a/content/v2.1/actions/formats-and-mime-types.md b/content/v2.1/actions/formats-and-mime-types.md index 51906948..787a1edd 100644 --- a/content/v2.1/actions/formats-and-mime-types.md +++ b/content/v2.1/actions/formats-and-mime-types.md @@ -188,6 +188,7 @@ If you need your actions to work with additional MIME types, you can configure t module Bookshelf class App < Hanami::App + # config.actions.formats.add :html config.actions.formats.add :custom, "application/custom" end end @@ -195,6 +196,8 @@ end This will add the `:custom` format for the `"application/custom"` MIME type and also configure your actions to use this format. +The **first format added will be the default format**, so you likely want to add `:html` or `:json` before any custom formats. + You can also configure a format to map to multiple MIME types: ```ruby diff --git a/content/v2.2/actions/formats-and-mime-types.md b/content/v2.2/actions/formats-and-mime-types.md index 51906948..787a1edd 100644 --- a/content/v2.2/actions/formats-and-mime-types.md +++ b/content/v2.2/actions/formats-and-mime-types.md @@ -188,6 +188,7 @@ If you need your actions to work with additional MIME types, you can configure t module Bookshelf class App < Hanami::App + # config.actions.formats.add :html config.actions.formats.add :custom, "application/custom" end end @@ -195,6 +196,8 @@ end This will add the `:custom` format for the `"application/custom"` MIME type and also configure your actions to use this format. +The **first format added will be the default format**, so you likely want to add `:html` or `:json` before any custom formats. + You can also configure a format to map to multiple MIME types: ```ruby