Method: ApplicationController#node_class
- Defined in:
- lib/generators/dummy/templates/controllers/application_controller.rb
#node_class ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/generators/dummy/templates/controllers/application_controller.rb', line 34 def node_class if @node_class.blank? # this method detects whether the dummy application is running in a single or multiple node context routing = Releaf::Content.routing if routing.length == 1 # for single node class site # the node class is the first and only defined class node_class = routing.keys.first.constantize else # for multinode sites # for non-node routes the node class can be detected from hostname via routing config node_class = Releaf::Content.routing.find { |node_class_name, | request.host =~ [:constraints][:host] }.first.constantize end @node_class = node_class end @node_class end |