Flowdock
method

singular_class_name

Importance_1
v2.3.8 - Show latest stable - 1 note - Class: ActionController::RecordIdentifier
singular_class_name(record_or_class) public

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

  singular_class_name(post)             # => "post"
  singular_class_name(Highrise::Person) # => "highrise_person"
Show source
Register or log in to add new notes.
March 19, 2010
1 thank

singular_class_name method missing

If this method is undefined in ActionView::Base, add to your ApplicationController:

class ApplicationController < ActionController::Base
  helper_method :singular_class_name
end