Padrino::Admin::Helpers::ViewHelpers

Module: Padrino::Admin::Helpers::ViewHelpers

Instance Method Summary

Instance Method Details

#model_attribute_translate(model, attribute) ⇒ String Also known as: t_attr

Translates attribute name for the given model.

Examples:

# => t("models.account.attributes.email", :default => "Email")
mat(:account, :email)

Parameters:

  • model (Symbol) — The model name for the translation.
  • attribute (Symbol) — The attribute name in the model to translate.

Returns:

  • (String) — The translated attribute name for the current locale.

#model_translate(model) ⇒ String Also known as: mt

Translates model name.

Examples:

# => t("models.account.name", :default => "Account")
mt(:account)

Parameters:

  • attribute (Symbol) — The attribute name in the model to translate.

Returns:

  • (String) — The translated model name for the current locale.

#padrino_admin_translate(word, *args) ⇒ String Also known as: pat

Translates a given word for padrino admin.

Examples:

# => t("padrino.admin.profile",  :default => "Profile")
pat(:profile)

# => t("padrino.admin.profile",  :default => "My Profile")
pat(:profile, "My Profile")

Parameters:

  • word (String) — The specified word to admin translate.
  • default (String) — The default fallback if no word is available for the locale.

Returns:

  • (String) — The translated word for the current locale.

#tag_icon(icon, tag = nil) ⇒ String

Icon's Bootstrap helper.

Examples:

tag_icon(:edit, :list)

Parameters:

  • icon (Symbol) — The specified icon type.
  • tag (Symbol) (defaults to: nil) — The HTML tag.

Returns:

  • (String) — HTML tag with prepend icon
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部