Class: ActionDispatch::Routing::Mapper::Resources::SingletonResource
Overview
:nodoc:
Constant Summary collapse
- DEFAULT_ACTIONS =
[:show, :create, :update, :destroy, :new, :edit]
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(entities, options) ⇒ SingletonResource
constructor
A new instance of SingletonResource.
- #plural ⇒ Object
- #singular ⇒ Object (also: #member_name, #collection_name)
Methods inherited from Resource
#actions, #default_actions, #name, #new_scope, #resource_scope
Constructor Details
#initialize(entities, options) ⇒ SingletonResource
Returns a new instance of SingletonResource.
945 946 947 948 949 950 951 |
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 945 def initialize(entities, ) super @as = nil @controller = ([:controller] || plural).to_s @as = [:as] end |
Instance Method Details
#plural ⇒ Object
953 954 955 |
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 953 def plural @plural ||= name.to_s.pluralize end |
#singular ⇒ Object Also known as: member_name, collection_name
957 958 959 |
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 957 def singular @singular ||= name.to_s end |