Module: Apotomo::Rails::ControllerMethods::ClassMethods

Defined in:
lib/apotomo/rails/controller_methods.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) has_widgets(&block)

Yields the root widget to setup your widgets for a controller. The block is executed in controller instance context, so you may use instance methods and variables of the controller.

Example:

class PostsController < ApplicationController
  has_widgets do |root|
    root << widget(:comments, :user => current_user)
  end


43
44
45
# File 'lib/apotomo/rails/controller_methods.rb', line 43

def has_widgets(&block)
  has_widgets_blocks << block
end