titleize

titleize() Instance Public methods Capitalizes all the words and replaces some characters in the string to create a nicer looking title. titleize is meant for creating pretty output. It is not used in the Rails internals. titleize is also aliased as titlecase. 'man from the boondocks'.titleize # => "Man From The Boondocks" 'x-men: the last stand'.titleize # => "X Men: The Last Stand" titlecase

attachments

attachments() Instance Public methods Allows you to add attachments to an email, like so: mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg') If you do this, then Mail will take the file name and work out the mime type set the Content-Type, Content-Disposition, Content-Transfer-Encoding and base64 encode the contents of the attachment all for you. You can also specify overrides if you want by passing a hash instead of a string: mail.attachments['filename.jpg'] =

accessing_controller_name_in_template

accessing_controller_name_in_template() Instance Public methods

to_formatted_s

to_formatted_s(format = :default) Instance Public methods Extends Array#to_s to convert a collection of elements into a comma separated id list if :db argument is given as the format. Blog.all.to_formatted_s(:db) # => "1,2,3" to_s

environment

environment() Instance Public methods

execute

execute() Instance Public methods Executes the given block and updates the latest watched files and timestamp.

human

human(options={}) Instance Public methods Transform the model name into a more humane format, using I18n. By default, it will underscore then humanize the class name. class BlogPost extend ActiveModel::Naming end BlogPost.model_name.human # => "Blog post" Specify options with additional translating options.

add_column_sql

add_column_sql(table_name, column_name, type, options = {}) Instance Protected methods

sum

sum(*args) Instance Public methods Calculates the sum of values on a given column. The value is returned with the same data type of the column, 0 if there's no row. See calculate for examples with options. Person.sum(:age) # => 4562

partial_collection_with_locals

partial_collection_with_locals() Instance Public methods