Module: TailwindTheme::ControllerConcern

Extended by:
ActiveSupport::Concern
Defined in:
lib/tailwind_theme/controller_concern.rb

Overview

Adds the methods and helpers to the controller for setting and getting the TailwindTheme

Instance Method Summary collapse

Instance Method Details

#theme(name = nil) ⇒ TailwindTheme::Theme, NilClass

The specified TailwindTheme for the controller

Parameters:

  • name (String, Symbol, NilClass) (defaults to: nil)

    the name of the theme to use. Defaults to the theme set by the ‘theme` class method.

Returns:

  • (TailwindTheme::Theme, NilClass)

    returns the specified theme or Nil if the theme is not defined.



34
35
36
# File 'lib/tailwind_theme/controller_concern.rb', line 34

def theme(name = nil)
  theme_factory.theme(name.presence || self.class._theme)
end