Module: ActsAsDashboard

Defined in:
lib/acts_as_dashboard/config.rb,
lib/acts_as_dashboard/widget.rb,
lib/acts_as_dashboard/class_methods.rb,
lib/acts_as_dashboard/instance_methods.rb,
lib/acts_as_dashboard/line_graph_widget.rb,
lib/acts_as_dashboard/short_messages_widget.rb,
lib/acts_as_dashboard.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Config, LineGraphWidget, ShortMessagesWidget, Widget, WidgetNotFound

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
# File 'lib/acts_as_dashboard.rb', line 14

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#widget_dataObject

Raises:



17
18
19
20
21
22
23
24
# File 'lib/acts_as_dashboard/instance_methods.rb', line 17

def widget_data
  name    = params[:path].first
  widget  = dashboard_config.find_widget name

  raise WidgetNotFound, %Q(No widget named "#{name}" found.) if widget.nil?

  render :text => widget.block.call
end