inside a
), and will raise an exception
# (Fortitude::Errors::InvalidElementNesting) if you do something the HTML spec disallows.
# This can be extremely useful in helping you to write clean HTML.
#
# There is a small speed penalty for turning this on, so it's recommended you only enable
# it in development mode.
# enforce_element_nesting_rules false
# enforce_attribute_rules: default false
#
# If set to true, Fortitude will prevent you from using any attribute that isn't defined
# in the HTML spec, and will raise a Fortitude::Errors::InvalidElementAttributes error
# if you do otherwise. (Note that any attribute starting with 'data-' or 'aria-' is allowed,
# since that's in the spec.) This can be extremely useful in helping you to write clean
# HTML.
#
# There is a small speed penalty for turning this on, so it's recommended you only enable
# it in development mode.
# enforce_attribute_rules false
# enforce_id_uniqueness: default false
#
# If set to true, Fortitude will prevent you from giving multiple elements the same 'id'
# on a page, and will raise a Fortitude::Errors::DuplicateId if you do. This can be
# extremely useful in helping you to write clean HTML.
#
# There is a small speed penalty for turning this on, so it's recommended you only enable
# it in development mode.
# enforce_id_uniqueness false
# close_void_tags: default false
#
# In HTML5, "self-closing" tags like `
` can be written as `
` or `
`; either is
# legal. (In HTML4, `
` is not legal, and neither is `
`. In XML, `
` or
# `
` is mandatory.) By default, Fortitude will output `
`. However, if you set
# `close_void_tags` to true, then Fortitude will output `
`, instead. Attempting to
# change this to true in a HTML4 doctype or false for an XHTML doctype will result in an
# error.
# close_void_tags false
# extra_assigns: default :ignore
#
# This controls what happens if you pass parameters to a widget that it hasn't declared a
# `need` for. If set to `:ignore`, it will simply ignore them; they will not be available to
# the widget to use. If set to `:use`, it will make them available for use in the widget --
# this is not recommended, however; it's better for the widget to declare all parameters
# it possibly could use, giving them defaults, instead of making undeclared parameters
# magically accessible. If set to `:error`, Fortitude will raise a
# Fortitude::Errors::ExtraAssigns in this case. (However, assigning "extra" variables in
# a Rails controller -- e.g., assigning `@foo`, then rendering a view that doesn't
# `need :foo` -- will never cause this error.)
#
# It can be useful to set this to :error if writing brand-new views (rather than translating
# old ERb views to Fortitude), since it will enforce cleaner code.
#
# There is a small speed penalty for setting this to `:use`.
# extra_assigns :ignore
# automatic_helper_access: default true
#
# If set to true, Fortitude's access to helpers works identically to ERb's -- i.e., you can
# use any helper in a Fortitude widget that would be accessible to an equivalent ERb view.
# If set to false, however, only helpers built-in to Rails and those you manually declare
# using `helper :foo` are accessible. This can be useful if starting to use Fortitude in
# a large, messy ERb/HAML/whatever codebase with many helpers, where you don't want new
# Fortitude code to start using a large variety of perhaps less-than-ideal helpers.
# automatic_helper_access true
# implicit_shared_variable_access: default false
#
# Rails ERb views use a giant bag of global state: not only can views access any `@foo`
# controller variable, but partials can, too, even if not passed to them -- and, even
# worse, they can _write_ to them. Fortitude disallows all of this by default; the only
# variables accessible to a Fortitude widget are those passed in directly and that it
# `:needs`. This results in vastly cleaner views. (If you really want to access such
# variables, even in Fortitude, they are available in a `shared_variables` `Hash`-like
# object that's accessible by widgets.)
#
# However, if you're translating legacy code from ERB/HAML/whatever to Fortitude, you may
# find that lots of code depends on this sort of action-at-a-distance, to the point where
# translating it is no longer feasible. If so, you can set `implicit_shared_variable_access`
# to `true`, and then you can read (and write!) any of these shared variables by simply
# using the normal syntax (`@foo`).
#
# There is a small speed penalty for enabling this.
# implicit_shared_variable_access false
# use_instance_variables_for_assigns: default false
#
# By default, parameters passed to a Fortitude widget are accessible using Ruby reader/
# method syntax (`foo`), and _not_ using Ruby instance-variable syntax (`@foo`). This
# has many advantages, not the least of which is that typos result in a clean exception
# instead of a "parameter" that happens to always be `nil`.
#
# However, if you're translating legacy code from ERB/HAML/whatever to Fortitude, you may
# find that lots of code depends on accessing parameters as instance variables. Setting
# this to `true` will expose parameters in both styles (`foo` and `@foo`). (Read, however,
# about `implicit_shared_variable_access`, above, too -- only by setting that also will
# Fortitude behave exactly like ERb in all such situations.)
# use_instance_variables_for_assigns false
# translation_base: default nil
#
# Rails' translation helper (usually called as `#t`, as in `t(:welcome_message)`) allows
# you to easily localize views. When called with a string starting with a dot,
# Rails normally prepends the view path to the key before looking it up -- for example,
# in app/views/foo/bar.html.rb, calling `t('.baz')` is equivalent to calling
# `t('foo.bar.baz'). However, in Fortitude, you can change this by setting `translation_base`
# to a string; this will prepend that string, before passing it onwards. (The
# `translation_base` string itself can even start with a dot, in which case it will be
# passed onwards to Rails' mechanism, which will then still add the view prefix before
# looking up the translation.)
#
# While generally not needed, this can be used to help clean up legacy applications with
# messy translations. For example, setting this to `fortitude.` will allow you to segregate
# all Fortitude translations under a top-level `fortitude` key, while setting it to
# `.fortitude.` will allow you to segregate each view's Fortitude translations under a
# Fortitude key underneath that view path.
#
# If this is used by any widget in the entire system, there is a small speed penalty applied
# to all calls of `#t` -- so only use this if you really need it.
# translation_base nil
# use_localized_content_methods: default false
#
# If set to true, then, if (for example) the locale is set to `fr`, Fortitude will look
# for a method in the widget called `#localized_content_fr`; if it exists, it will call
# that method _instead_ of `#content`. This provides support for views that may differ
# dramatically from one locale to the next.
#
# There is a very small speed penalty for any widget using this feature.
# use_localized_content_methods false
end