_normalize_options

_normalize_options(options) Instance Public methods Normalize options. :api: plugin

_normalize_args

_normalize_args(action=nil, options={}) Instance Public methods Normalize args by converting render âfooâ to render :action => âfooâ and render âfoo/barâ to render :file => âfoo/barâ. :api: plugin

with

with(routes) Class Public methods

new

new(error, path) Class Public methods

modules_for_helpers

modules_for_helpers(args) Instance Public methods Returns a list of modules, normalized from the acceptable kinds of helpers with the following behavior: String or Symbol :FooBar or âFooBarâ becomes âfoo_bar_helperâ, and âfoo_bar_helper.rbâ is loaded using require_dependency. Module No further processing After loading the appropriate files, the corresponding modules are returned. Parameters args - An array of helpers Returns Array - A normalized list of modules for

inherited

inherited(klass) Instance Public methods When a class is inherited, wrap its helper module in a new module. This ensures that the parent class's module can be changed independently of the child class's.

helper_method

helper_method(*meths) Instance Public methods Declare a controller method as a helper. For example, the following makes the current_user controller method available to the view: class ApplicationController < ActionController::Base helper_method :current_user, :logged_in? def current_user @current_user ||= User.find_by(id: session[:user]) end def logged_in? current_user != nil end end In a view: <% if logged_in? -%>Welcome, <%= current_user.name %>

helper

helper(*args, &block) Instance Public methods The helper class method can take a series of helper module names, a block, or both. Options *args - Module, Symbol, String block - A block defining helper methods When the argument is a module it will be included directly in the template class. helper FooHelper # => includes FooHelper When the argument is a string or symbol, the method will provide the â_helperâ suffix, require the file and include the module in the templa

clear_helpers

clear_helpers() Instance Public methods Clears up all existing helpers in this class, only keeping the helper with the same name as this class.

new

new(message = nil) Class Public methods