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

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

Instance Method Summary collapse

Instance Method Details

#has_widgets(&block) ⇒ Object

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_widget, 'post-comments', :user => @current_user)
  end


41
42
43
# File 'lib/apotomo/rails/controller_methods.rb', line 41

def has_widgets(&block)
  has_widgets_blocks << block
end