Sha256: 16d119b55dda447a67e86d51e84812157a6dbe69afc96692f4aa8f6329c476d1

Contents?: true

Size: 762 Bytes

Versions: 60

Compression:

Stored size: 762 Bytes

Contents

module Extface
  class ApplicationController < ActionController::Base
    prepend_before_filter :include_extra_module
    
    helper_method :extface
    
    def index
    end
    
    def extfaceable
      @extfaceable ||= extface_mapping.i_klass.find_by(extface_mapping.i_find_key => params[extface_mapping.i_param])
    end

    private
      def extface_mapping
        @extface_mapping ||= Extface::Mapping.find(request.fullpath)
      end
      
      def include_extra_module
        self.class.send(:include, extface_mapping.i_extra_module) if extface_mapping.i_extra_module.present?
      end
      
      def extface
        try(extface_mapping.mount_point) || super # rails 4.1 fixed named route for engines mounted for resources
      end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
extface-0.4.5 app/controllers/extface/application_controller.rb
extface-0.4.4b app/controllers/extface/application_controller.rb
extface-0.4.4a app/controllers/extface/application_controller.rb
extface-0.4.4 app/controllers/extface/application_controller.rb
extface-0.4.3g app/controllers/extface/application_controller.rb
extface-0.4.3f app/controllers/extface/application_controller.rb
extface-0.4.3e app/controllers/extface/application_controller.rb
extface-0.4.3d app/controllers/extface/application_controller.rb
extface-0.4.3c app/controllers/extface/application_controller.rb
extface-0.4.3b app/controllers/extface/application_controller.rb
extface-0.4.3a app/controllers/extface/application_controller.rb
extface-0.4.2a app/controllers/extface/application_controller.rb
extface-0.4.2 app/controllers/extface/application_controller.rb
extface-0.4.1b app/controllers/extface/application_controller.rb
extface-0.4.1a app/controllers/extface/application_controller.rb
extface-0.4.0 app/controllers/extface/application_controller.rb
extface-0.3.0c app/controllers/extface/application_controller.rb
extface-0.3.0b app/controllers/extface/application_controller.rb
extface-0.3.0a app/controllers/extface/application_controller.rb
extface-0.3.0 app/controllers/extface/application_controller.rb