class Marten::Template::Tag::CsrfInput
- Marten::Template::Tag::CsrfInput
- Marten::Template::Tag::Base
- Reference
- Object
Overview
The csrf_input
template tag.
The csrf_input
template tag allows generating a hidden HTML input tag containing the CSRF token.
For example, using {% csrf_input %}
in a template will generate the following HTML:
<input type="hidden" name="csrftoken" value="<csrfToken>" />
Where <csrfToken>
is the actual CSRF token.
Optionally, the output of this tag can be assigned to a specific variable using the as
keyword:
{% csrf_input as my_csrf_input %}
Included Modules
Defined in:
marten/template/tag/csrf_input.crConstructors
Instance Method Summary
-
#render(context : Context) : String
Render the template tag for a given context.
Instance methods inherited from module Marten::Template::Tag::CanSplitSmartly
split_smartly(expression : String) : Array(String)
split_smartly
Instance methods inherited from class Marten::Template::Tag::Base
render(context : Context) : String
render
Constructor methods inherited from class Marten::Template::Tag::Base
new(parser : Parser, source : String)
new
Constructor Detail
Instance Method Detail
Description copied from class Marten::Template::Tag::Base
Render the template tag for a given context.