Module: Plutonium::Core::Controller

Instance Method Summary collapse

Methods included from Plutonium::Core::Controllers::AssociationResolver

#resolve_association

Methods included from Plutonium::Core::Controllers::EntityScoping

#scoped_entity_class, #scoped_entity_param_key, #scoped_entity_route_key, #scoped_entity_strategy, #scoped_to_entity?

Methods included from Plutonium::Core::Controllers::Bootable

#current_engine, #current_package

Instance Method Details

#rail?Boolean

Whether the modern icon rail is active for this request. Resolves the per-controller ‘rail` setting, falling back to the shell default. Public: the resource layout calls `controller.rail?`.

Returns:

  • (Boolean)


71
72
73
74
# File 'lib/plutonium/core/controller.rb', line 71

def rail?
  return _rail_enabled unless _rail_enabled.nil?
  shell == :modern
end

#shellObject

Resolved shell variant for this request: controller override, else the engine’s shell, else the global Plutonium.configuration.shell.



78
79
80
81
82
83
84
85
86
# File 'lib/plutonium/core/controller.rb', line 78

def shell
  return _shell unless _shell.nil?

  engine = current_engine
  engine_shell = engine.shell unless engine == Rails.application.class
  return engine_shell unless engine_shell.nil?

  Plutonium.configuration.shell
end