class ActionDispatch::Routing::Mapper::Resources::Resource
:nodoc:
def actions
def actions if only = @options[:only] Array(only).map(&:to_sym) elsif except = @options[:except] default_actions - Array(except).map(&:to_sym) else default_actions end end
def collection_name
Checks for uncountable plurals, and appends "_index" if the plural
def collection_name singular == plural ? "#{plural}_index" : plural end
def default_actions
def default_actions [:index, :create, :new, :show, :update, :destroy, :edit] end
def initialize(entities, options = {})
def initialize(entities, options = {}) @name = entities.to_s @path = (options[:path] || @name).to_s @controller = (options[:controller] || @name).to_s @as = options[:as] @param = (options[:param] || :id).to_sym @options = options end
def member_scope
def member_scope "#{path}/:#{param}" end
def name
def name @as || @name end
def nested_param
def nested_param :"#{singular}_#{param}" end
def nested_scope
def nested_scope "#{path}/:#{nested_param}" end
def new_scope(new_path)
def new_scope(new_path) "#{path}/#{new_path}" end
def plural
def plural @plural ||= name.to_s end
def resource_scope
def resource_scope { :controller => controller } end
def singular
def singular @singular ||= name.to_s.singularize end