Skip to content

Commit

Permalink
Update 0.5 release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ellmetha committed May 30, 2024
1 parent cad27f4 commit 49230e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/handlers-and-http/reference/generic-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ end
Variables that are added to the global template context will automatically be available to the configured template's runtime.

:::tip
The default content type of the response generated when rendering templates is `text/html`, but this can be customized using the [`#content_type`](pathname:///api/dev/Marten/Handlers/Template.html#content_type%3AString|Nil-class-method) class method. For example:
The default content type of the response generated when rendering templates is `text/html`, but this can be customized using the [`#content_type`](pathname:///api/dev/Marten/Handlers/Rendering/ClassMethods.html#content_type(content_type%3AString|Nil)-instance-method) class method. For example:

```crystal
class MyHandler < Marten::Handlers::Template
Expand Down
1 change: 1 addition & 0 deletions docs/docs/the-marten-project/release-notes/0.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ article.category # => Category::BLOG
* The [`Marten::Handlers::RecordDetail`](../../handlers-and-http/reference/generic-handlers.md#displaying-a-record), [`Marten::Handlers::RecordUpdate`](../../handlers-and-http/reference/generic-handlers.md#updating-a-record), and [`Marten::Handlers::RecordDelete`](../../handlers-and-http/reference/generic-handlers.md#deleting-a-record) generic handlers now provide the ability to specify a custom [query set](../../models-and-databases/queries.md) instead of a model class. This can be achieved through the use of the [`#queryset`](pathname:///api/dev/Marten/Handlers/RecordRetrieving.html#queryset(queryset)-macro) macro.
* A new middleware was introduced to make it easy to override the method of incoming requests based on the value of a specific request parameter or header: the [method override middleware](../../handlers-and-http/reference/middlewares.md#method-override-middleware). This mechanism is useful for overriding HTTP methods in HTML forms that natively support GET and POST methods only. A dedicated set of [settings](../../development/reference/settings.md#method-overriding-settings) is also available to easily customize the behavior of this middleware.
* The value of the max-age directive used for the Cache-Control header that is set by the [assets serving middleware](../../handlers-and-http/reference/middlewares.md#asset-serving-middleware) can now be configured in the [`assets.max_age`](../../development/reference/settings.md#max_age) setting.
* Subclasses of the [`Marten::Handlers::Template`](../../handlers-and-http/reference/generic-handlers.md#rendering-a-template) generic handler now support a [`#content_type`](pathname:///api/dev/Marten/Handlers/Rendering/ClassMethods.html#content_type(content_type%3AString|Nil)-instance-method) class method that allows configuring the content type of the response (unless specified, the content type will default to `text/html`).

#### Templates

Expand Down

0 comments on commit 49230e5

Please sign in to comment.