Module: Modular::ActionControllerExtension

Extended by:
ActiveSupport::Concern
Defined in:
lib/modular/action_controller_extension.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#get_layout_path(name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/modular/action_controller_extension.rb', line 8

def get_layout_path(name)
  if name.is_a?(Symbol) 
    name = self.__send__(name)
  end

  path = ::Modular::LayoutGenerator.generate(name)

  #cutting off '.html.erb' and relative path prefix

  "../../../#{path[0, path.length-9]}"
end

#modular_layout(name) ⇒ Object



4
5
6
# File 'lib/modular/action_controller_extension.rb', line 4

def modular_layout(name)
  render :layout => get_layout_path(name)
end