Module: Xhive::Widgify

Included in:
PagesController
Defined in:
lib/xhive/widgify.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

Public: creates an array with the actions to exclude from layout.



16
17
18
# File 'lib/xhive/widgify.rb', line 16

def self.extended(base)
  base.class_variable_set "@@widgets_list", []
end

Instance Method Details

#widgify(*actions) ⇒ Object

Public: remove layout from action and create Liquid tag class.

actions - The array of actions to widgify.



7
8
9
10
11
12
# File 'lib/xhive/widgify.rb', line 7

def widgify(*actions)
  actions.each do |action|
    remove_layout_for_action(action)
    Xhive::TagFactory.create_class(tag_name_for(action), route_for(action))
  end
end