apidock.com Archives - 12 September 2013, Thursday

  • first_or_initialize (ActiveRecord::Relation)

    apidock.com 11 Sep '13, 8am

    first_or_initialize (attributes = nil, options = {}, &block) public Like first_or_create but calls new instead of create . Expects arguments in the same format as Base.new. Show source # File activerecord/lib/active_record/relation.rb, line 131 def first_or_initialize ( attributes = n...

  • human_attribute_name (ActiveModel::Translation)

    apidock.com 10 Sep '13, 3am

    Transforms attribute names into a more human format, such as “First name” instead of “first_name”. Person . human_attribute_name (" first_name ") # => "First name" Specify options with additional translating options.

  • Search Ruby on Rails documentation

    apidock.com 10 Sep '13, 1am

    Welcome Register Projects Help About Blog Use OpenID Login Password OpenID URL Remember me RSpec Ruby Ruby on Rails Flowdock Search documentation Add Ruby on Rails quicksearch to your browser No results found for ":qa" Welcome Register Projects Help About Blog APIdock release: IRON ST...

  • inject (Enumerable)

    apidock.com 09 Sep '13, 9pm

    If you specify a block, then for each element in enum the block is passed an accumulator value (memo ) and the element. If you specify a symbol instead, then each element in the collection will be passed to the named method of memo . In either case, the result becomes the new value fo...

  • to_sentence (Array)

    apidock.com 07 Sep '13, 12am

    Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options: :words_connector - The sign or word used to join the elements in arrays with two or more elements (default: “, ”) :two_words_connector - The sign or word used to join the ...

  • ActionView::Helpers::FormBuilder

    apidock.com 20 Jul '13, 4pm

    No documentation This class has no description. You can help the Ruby on Rails community by adding new notes. Show files where this class is defined (3 files) actionpack/lib/action_view/helpers/date_helper.rb actionpack/lib/action_view/helpers/form_options_helper.rb actionpack/lib/act...

    Related:
    1. Net::HTTP apidock.com 20 Jul '13, 2am
  • Net::HTTP

    apidock.com 20 Jul '13, 2am

    For example, all 2XX responses are instances of a Net::HTTPSuccess subclass, a 3XX response is an instance of a Net::HTTPRedirection subclass and a 200 response is an instance of the Net::HTTPOK class. For details of response classes, see the section “HTTP Response Classes” below.

  • intern (String)

    apidock.com 30 Jun '13, 4pm

    Returns the Symbol corresponding to str, creating the symbol if it did not previously exist. See Symbol#id2name . " Koala ". intern #=> :Koala s = ' cat '. to_sym #=> :cat s == :cat #=> true s = ' @cat '. to_sym #=> :@cat s == :@cat #=> true This can also be used to create symbols tha...

  • except (Hash)

    apidock.com 15 Jun '13, 3am

    Return a hash that includes everything but the given keys. This is useful for limiting a set of parameters to everything but a few known toggles:

  • caches_page (ActionController::Caching::Pages::ClassMethods)

    apidock.com 28 May '13, 8am

    using the page-caching approach that’ll store the cache in a path within the page_cache_directory that matches the triggering url.

  • to_sentence (ActiveSupport::CoreExtensions::Array::Conversions)

    apidock.com 24 May '13, 4pm

    Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options: :words_connector - The sign or word used to join the elements in arrays with two or more elements (default: ", ") :two_words_connector - The sign or word used to join the ...

  • assert_dom_equal (ActionController::Assertions::DomAssertions)

    apidock.com 22 May '13, 2am

    This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here. These similar methods exist in v3.2.13: ActionDispatch::Assertions::DomAssertions#assert_dom_equal

  • each_cons (Enumerable)

    apidock.com 20 May '13, 7am

    Iterates the given block for each array of consecutive <n> elements. If no block is given, returns an enumerator.

  • each_slice (Enumerable)

    apidock.com 19 May '13, 2am

    Welcome Register Projects Help About Blog APIdock release: IRON STEVE (1.4) If you have any comments, ideas or feedback, feel free to contact us at APIdock copyright Nodeta Oy 2008-2013 Flowdock - Team Inbox With Chat Flowdock is a collaboration tool for technical teams. Version contr...

  • with_defaults (Rake::TaskArguments)

    apidock.com 07 May '13, 8pm

    Specify a hash of default values for task arguments. Use the defaults only if there is no specific value for the given argument. Show source # File lib/rake/task_arguments.rb, line 38 def with_defaults ( defaults ) @hash = defaults . merge ( @hash ) end

  • fresh_when (ActionController::ConditionalGet)

    apidock.com 03 May '13, 9pm

    This will render the show template if the request isn’t sending a matching etag or If-Modified-Since header and just a

  • merge (ActiveRecord::SpawnMethods)

    apidock.com 30 Apr '13, 4am

    Makes it possible to use a scope through an association This is a very useful method if you want to to use a scope through an association: class Book < ActiveRecord :: Base scope :available , where ( :available => true ) end class Author < ActiveRecord :: Base has_many :books scope :w...

  • validates (ActiveModel::Validations::ClassMethods)

    apidock.com 27 Apr '13, 11am

    This method is a shortcut to all default validators and any custom validator classes ending in ‘Validator’. Note that Rails default validators can be overridden inside specific classes by creating custom validator classes in their place such as

  • try (Object)

    apidock.com 26 Apr '13, 6am

    rest of code is in NilClass#try If you click “Show source” here, you may get confused. The logic for #try is shared between this method and NilClass#try . Both versions are currently implemented in the file activesupport/lib/active_support/core_ext/object/try.rb .

  • display (Object)

    apidock.com 24 Apr '13, 2pm

    Welcome Register Projects Help About Blog APIdock release: IRON STEVE (1.4) If you have any comments, ideas or feedback, feel free to contact us at APIdock copyright Nodeta Oy 2008-2013 Flowdock - Team Inbox With Chat for Software Developers Check out how the team behind APIdock conne...

  • update_attributes (ActiveRecord::Persistence)

    apidock.com 24 Apr '13, 5am

    Updates the attributes of the model from the passed-in hash and saves the record, all wrapped in a transaction. If the object is invalid, the saving will fail and false will be returned. When updating model attributes, mass-assignment security protection is respected. If no :as option...

  • attr_accessor_with_default (Module)

    apidock.com 18 Apr '13, 4pm

    Method deprecated or moved This method is deprecated or moved on the latest stable version. The last existing version (v3.1.0) is shown here. attr_accessor_with_default (sym, default = Proc.new) public Declare an attribute accessor with an initial default return value. To give attribu...

  • forty_two (Array)

    apidock.com 17 Apr '13, 5pm

    Equal to self[41] . Also known as accessing “the reddit”. Show source # File activesupport/lib/active_support/core_ext/array/access.rb, line 43 def forty_two self [ 41 ] end

  • ActiveRecord::Base

    apidock.com 17 Apr '13, 11am

    directly, but rather infer them from the table definition with which they’re linked. Adding, removing, and changing attributes and their type is done directly in the database. Any change is instantly reflected in the Active Record objects. The mapping that binds a given Active Record ...

  • (Hash)

    apidock.com 17 Apr '13, 7am

    populated with the given objects. Equivalent to the literal { key => value, … }. In the first form, keys and values occur in pairs, so there must be an even number of arguments. The second and third form take a single argument which is either an array of key-value pairs or an object c...

  • jj (Kernel)

    apidock.com 13 Apr '13, 9pm

    strings in a pretty format, with indentation and over many lines.

  • expires_in (ActionController::ConditionalGet)

    apidock.com 10 Apr '13, 8pm

    be aware that this writes to tmp/cache Its supposed to be http caching, but Rails will actually cache the response to whatever you specified as the cache store, *as well*, but only if you specify :public => true. The default is filestore so it will try to write to tmp/cache. Only a pr...

  • Set

    apidock.com 08 Apr '13, 12am

    ). Most of the initializer methods and binary operators accept generic Enumerable objects besides sets and arrays. An

  • increment! (ActiveRecord::Base)

    apidock.com 04 Apr '13, 2pm

    that saves the record. This method differs from its non-bang version in that it passes through the attribute setter. Saving is not subjected to validation checks. Returns

  • Net::HTTP

    apidock.com 04 Apr '13, 12pm

    If you wish to re-use a connection across multiple HTTP requests without automatically closing it you can use ::new instead of ::start . #request will automatically open a connection to the server if one is not currently open. You can manually close the connection with