apidock.com Archives - 28 September 2013, Saturday

  • constantize (String)

    apidock.com 27 Sep '13, 2pm

    find a declared constant with the name specified in the string. It raises a NameError when the name is not in CamelCase or is not initialized. See

    Related:
    1. String initialziation ruby-forum.com 28 Sep '13, 12am
  • deep_dup (Hash)

    apidock.com 27 Sep '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 Flowdock is a collaboration tool for technical teams. Version contr...

    Related:
    1. ActionController::Streaming apidock.com 06 Oct '13, 12pm
  • to_time (Date)

    apidock.com 26 Sep '13, 7am

    where the time is set to the beginning of the day. The timezone can be either :local or :utc (default :local).

    Related:
    1. ActionController::Streaming apidock.com 06 Oct '13, 12pm
  • except (ActiveRecord::SpawnMethods)

    apidock.com 25 Sep '13, 9pm

    Removes from the query the condition(s) specified in skips . Example: Post . order (' id asc '). except ( :order ) # discards the order condition Post . where (' id > 10 '). order (' id asc '). except ( :where ) # discards the where condition but keeps the order Show source # File act...

  • reorder (ActiveRecord::QueryMethods)

    apidock.com 25 Sep '13, 9pm

    Replaces any existing order defined on the relation with the specified order . User . order (' email DESC '). reorder (' id ASC ') # generated SQL has 'ORDER BY id ASC' Subsequent calls to order on the same relation will be appended. For example: User . order (' email DESC '). reorder...

  • of_caller (Binding)

    apidock.com 17 Sep '13, 12pm

    must be the last statement in the method. This means that you will have to put everything you want to do after the call to Binding.of_caller into the block of it. This should be no problem however, because Ruby has closures. If you don’t do this an Exception will be raised. Because of...

  • explain (ActiveRecord::Relation)

    apidock.com 13 Sep '13, 2am

    Runs EXPLAIN on the query or queries triggered by this relation and returns the result as a string. The string is formatted imitating the ones printed by the database shell. Note that this method actually runs the queries, since the results of some are needed by the next ones when eag...

  • 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