Padrino::Helpers::FormHelpers::Security

Module: Padrino::Helpers::FormHelpers::Security

Overview

Helpers to generate form security tags for csrf protection.

Instance Method Summary

Instance Method Details

#csrf_meta_tags ⇒ String

Constructs meta tags `csrf-param` and `csrf-token` with the name of the cross-site request forgery protection parameter and token, respectively.

Examples:

csrf_meta_tags

Returns:

  • (String) — The meta tags with the CSRF token and the param your app expects it in.

#csrf_token_field ⇒ String

Constructs a hidden field containing a CSRF token.

Examples:

csrf_token_field

Parameters:

  • token (String) — The token to use. Will be read from the session by default.

Returns:

  • (String) — The hidden field with CSRF token as value.
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部