Module: AdminWidgets::Helper

Defined in:
lib/admin_widgets/helper.rb

Instance Method Summary collapse

Instance Method Details

#admin_widget(name, options = {}, &block) ⇒ Object



4
5
6
7
8
# File 'lib/admin_widgets/helper.rb', line 4

def admin_widget(name, options = {}, &block)
  widget_class = "::AdminWidgets::#{name.to_s.camelize}Widget".constantize
  options = options.merge(:controller => controller, :block => block)
  widget_class.new(options).to_html
end