localize

localize(*args) Instance Public methods Delegates to I18n.localize with no additional functionality. See rubydoc.info/github/svenfuchs/i18n/master/I18n/Backend/Base:localize for more information. l

t

t(key, options = {}) Instance Public methods Alias for: translate

translate

translate(key, options = {}) Instance Public methods Delegates to I18n#translate but also performs three additional functions. First, it will ensure that any thrown MissingTranslation messages will be turned into inline spans that: * have a "translation-missing" class set, * contain the missing key as a title attribute and * a titleized version of the last key segment as a text. E.g. the value returned for a missing translation key :âblog.post.titleâ will be <span class=âtransl

_url_for_modules

_url_for_modules() Instance Public methods

button_to

button_to(name = nil, options = nil, html_options = nil, &block) Instance Public methods Generates a form containing a single button that submits to the URL created by the set of options. This is the safest method to ensure links that cause changes to your data are not triggered by search bots or accelerators. If the HTML button does not work with your layout, you can also consider using the link_to method with the :method modifier as described in the link_to documentation. By

current_page?

current_page?(options) Instance Public methods True if the current request URI was generated by the given options. Examples Let's say we're in the http://www.example.com/shop/checkout?order=desc action. current_page?(action: 'process') # => false current_page?(controller: 'shop', action: 'checkout') # => true current_page?(controller: 'shop', action: 'checkout', order: 'asc') # => false current_page?(action: 'checkout') # => true current_page?(controller: 'library',

link_to

link_to(name = nil, options = nil, html_options = nil, &block) Instance Public methods Creates a link tag of the given name using a URL created by the set of options. See the valid options in the documentation for url_for. It's also possible to pass a String instead of an options hash, which generates a link tag that uses the value of the String as the href for the link. Using a :back Symbol instead of an options hash will generate a link to the referrer (a JavaScript back link

link_to_if

link_to_if(condition, name, options = {}, html_options = {}, &block) Instance Public methods Creates a link tag of the given name using a URL created by the set of options if condition is true, otherwise only the name is returned. To specialize the default behavior, you can pass a block that accepts the name or the full argument list for link_to_unless (see the examples in link_to_unless). Examples <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action:

link_to_unless

link_to_unless(condition, name, options = {}, html_options = {}, &block) Instance Public methods Creates a link tag of the given name using a URL created by the set of options unless condition is true, in which case only the name is returned. To specialize the default behavior (i.e., show a login link rather than just the plaintext link text), you can pass a block that accepts the name or the full argument list for link_to_unless. Examples <%= link_to_unless(@current_user.ni

link_to_unless_current

link_to_unless_current(name, options = {}, html_options = {}, &block) Instance Public methods Creates a link tag of the given name using a URL created by the set of options unless the current request URI is the same as the links, in which case only the name is returned (or the given block is yielded, if one exists). You can give link_to_unless_current a block which will specialize the default behavior (e.g., show a âStart Hereâ link rather than the link's text). Examples Let's