render

render(*args, &block) Instance Public methods Normalize arguments, options and then delegates #render_to_body and sticks the result in self.response_body. :api: public

new

InstructionSequence.new(source[, file[, path[, line[, options]]]]) â iseq Class Public methods Takes source, a String of Ruby code and compiles it to an InstructionSequence. Optionally takes file, path, and line which describe the filename, absolute path and first line number of the ruby code in source which are metadata attached to the returned iseq. options, which can be true, false or a Hash, is used to modify the default behavior of the Ruby iseq compiler. For details regarding

token_and_options

token_and_options(request) Instance Public methods Parses the token and options out of the token authorization header. If the header looks like this: Authorization: Token token="abc", nonce="def" Then the returned token is âabcâ, and the options is {nonce: âdefâ} request - ActionDispatch::Request instance with the current headers. Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

getc

getc() Instance Public methods See Zlib::GzipReader documentation for a description.

number_with_delimiter

number_with_delimiter(number, options = {}) Instance Public methods Formats a number with grouped thousands using delimiter (e.g., 12,324). You can customize the format in the options hash. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :delimiter - Sets the thousands delimiter (defaults to â,â). :separator - Sets the separator between the fractional and integer digits (defaults to â.â). :raise - If true, raises InvalidNumberError w

capture

capture(*args) Instance Public methods The capture method allows you to extract part of a template into a variable. You can then use this variable anywhere in your templates or layout. The capture method can be used in ERB templates⦠<% @greeting = capture do %> Welcome to my shiny new web page! The date and time is <%= Time.now %> <% end %> â¦and Builder (RXML) templates. @timestamp = capture do "The current timestamp is #{Time.now}." end You can then us

references

references(*table_names) Instance Public methods Use to indicate that the given table_names are referenced by an SQL string, and should therefore be JOINed in any query rather than loaded separately. This method only works in conjuction with includes. See includes for more details. User.includes(:posts).where("posts.name = 'foo'") # => Doesn't JOIN the posts table, resulting in an error. User.includes(:posts).where("posts.name = 'foo'").references(:posts) # => Query now know

[]=

[]=(name, value) Instance Public methods Stores an individual Ruby object or a hierarchy of Ruby objects in the data store file under the root name. Assigning to a name already in the data store clobbers the old data. Example: require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction # load some data into the store... store[:single_object] = "My data..." store[:obj_heirarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],

delete

delete(id_or_array) Instance Public methods Deletes the row with a primary key matching the id argument, using a SQL DELETE statement, and returns the number of rows deleted. Active Record objects are not instantiated, so the object's callbacks are not executed, including any :dependent association options. You can delete multiple rows at once by passing an Array of ids. Note: Although it is often much faster than the alternative, #destroy, skipping callbacks might bypass business

rindex

str.rindex(substring [, fixnum]) â fixnum or nilstr.rindex(regexp [, fixnum]) â fixnum or nil Instance Public methods Returns the index of the last occurrence of the given substring or pattern (regexp) in str. Returns nil if not found. If the second parameter is present, it specifies the position in the string to end the searchâcharacters beyond this point will not be considered. "hello".rindex('e') #=> 1 "hello".rindex('l') #=> 3 "hello".rindex('