module Undercarriage::Controllers::Restful::UtilityConcern

Utility

Utility helper methods

Usage

class ExamplesController < ApplicationController
  include Undercarriage::Controllers::Restful::UtilityConcern
end

Protected Instance Methods

controller_name_singular() click to toggle source

Singular controller name

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 26
def controller_name_singular
  controller_name.to_s.singularize
end
controller_name_singular_human()
controller_name_singular_title() click to toggle source

Titleized controller name

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 33
def controller_name_singular_title
  controller_name_singular.titleize
end
instance_name() click to toggle source

Instance name

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 62
def instance_name
  model_name
end
instances_name() click to toggle source

Instances name

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 55
def instances_name
  controller_name.to_s
end
model_class() click to toggle source

Model class

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 48
def model_class
  model_name.classify.constantize
end
model_name() click to toggle source

Model name

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 41
def model_name
  controller_name_singular
end
resource_scope() click to toggle source

Resource scope

# File lib/undercarriage/controllers/restful/utility_concern.rb, line 69
def resource_scope
  model_name.to_sym
end