Class: WakariController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/wakari_controller.rb

Class Method Summary collapse

Class Method Details

.controller_pathObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/wakari_controller.rb', line 3

def self.controller_path
  unless anonymous?
    @controller_path ||= begin
      model_name = name.sub(/Controller$/, '').singularize
      model_name.constantize.model_name.collection.tap do |t|
        t.instance_eval do
          def include?(arg)  # Rails hack! actionpack/lib/action_view/renderer/partial_renderer.rb
            arg == "/" ? false : super
          end
        end
      end
    end
  end
end