Sha256: a60a9ff24f81c1b4bfeeab3bb4d11fd95bd199351f21ec41f702d95fedcd6c3f

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

module ResourceController
  ACTIONS           = [:index, :show, :new_action, :create, :edit, :update, :destroy].freeze
  SINGLETON_ACTIONS = (ACTIONS - [:index]).freeze
  FAILABLE_ACTIONS  = ACTIONS - [:index, :new_action, :edit].freeze
  NAME_ACCESSORS    = [:model_name, :route_name, :object_name]

  autoload :Accessors,              'resource_controller/accessors'
  autoload :ActionOptions,          'resource_controller/action_options'
  autoload :Actions,                'resource_controller/actions'
  autoload :Base,                   'resource_controller/base'
  autoload :ClassMethods,           'resource_controller/class_methods'
  autoload :Controller,             'resource_controller/controller'
  autoload :FailableActionOptions,  'resource_controller/failable_action_options'
  autoload :Helpers,                'resource_controller/helpers'
  autoload :ResponseCollector,      'resource_controller/response_collector'
  autoload :Singleton,              'resource_controller/singleton'
  autoload :Urligence,              'urligence'
  class Railtie < Rails::Railtie
  end
end

class ActionController::Base

  def self.resource_controller(*args)
    include ResourceController::Controller
    include ResourceController::Urligence
    extend ResourceController::ClassMethods
    helper_method :smart_url

    if args.include?(:singleton)
      include ResourceController::Helpers::SingletonCustomizations
    end
  end

end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
makandra_resource_controller-0.8.0 lib/resource_controller.rb
makandra_resource_controller-0.7.3 lib/resource_controller.rb
makandra_resource_controller-0.7.2 lib/resource_controller.rb
makandra_resource_controller-0.7.1 lib/resource_controller.rb
makandra_resource_controller-0.7.0 lib/resource_controller.rb