render_body

render_body(context, options) Instance Public methods Render but returns a valid Rack body. If fibers are defined, we return a streaming body that renders the template piece by piece. Note that partials are not supported to be rendered with streaming, so in such cases, we just wrap them in an array.

anonymous?

anonymous?() Instance Public methods A module may or may not have a name. module M; end M.name # => "M" m = Module.new m.name # => nil A module gets a name when it is first assigned to a constant. Either via the module or class keyword or by an explicit assignment: m = Module.new # creates an anonymous module M = m # => m gets a name here as a side-effect m.name # => "M"

alias_attribute

alias_attribute(new_name, old_name) Instance Public methods Allows you to make aliases for attributes, which includes getter, setter, and query methods. class Content < ActiveRecord::Base # has a title attribute end class Email < Content alias_attribute :subject, :title end e = Email.find(1) e.title # => "Superstars" e.subject # => "Superstars" e.subject? # => true e.subject = "Megastars" e.title # => "Megastars"

body

body() Instance Public methods The request body is an IO input stream. If the RAW_POST_DATA environment variable is already set, wrap it in a StringIO.

register

register(string, symbol, mime_type_synonyms = [], extension_synonyms = [], skip_lookup = false) Class Public methods

respond_to_missing?

respond_to_missing?(method, include_private = false) Instance Public methods

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

collection

collection() Instance Public methods To add a route to the collection: resources :photos do collection do get 'search' end end This will enable Rails to recognize paths such as /photos/search with GET, and route to the search action of PhotosController. It will also create the search_photos_url and search_photos_path route helpers.

scope

scope(*args) Instance Public methods Scopes a set of routes to the given default options. Take the following route definition as an example: scope path: ":account_id", as: "account" do resources :projects end This generates helpers such as account_projects_path, just like resources does. The difference here being that the routes generated are like /:account_id/projects, rather than /accounts/:account_id/projects. Options Takes same options as Base#match and Resources#resources.

new

new(hash = {}, pattern=nil) Class Public methods