instance method singular_class_name

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

singular_class_name(record_or_class)

Returns the singular class name of a record or class. Examples:

singular_class_name(post)             # => "post"
singular_class_name(Highrise::Person) # => "highrise_person"

Parameters

record_or_class req
Source
# File actionpack/lib/action_controller/record_identifier.rb, line 95
    def singular_class_name(record_or_class)
      model_name_from_record_or_class(record_or_class).singular
    end

Defined in actionpack/lib/action_controller/record_identifier.rb line 95 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::RecordIdentifier

Type at least 2 characters to search.

↑↓ navigate · open · esc close