Returns an array with all the available widgets
Example: available_widgets.include?(:my_widgets)
# File vendor/plugins/ubiquo_design/lib/ubiquo_design/ubiquo_widgets.rb, line 89
89: def available_widgets
90: ::Widget.behaviours.keys
91: end
Renders the widget as a string
The widget is the instance to be rendered
# File vendor/plugins/ubiquo_design/lib/ubiquo_design/ubiquo_widgets.rb, line 101
101: def render_widget widget
102: widget_name = widget.key
103: unless available_widgets.include?(widget_name)
104: require "widgets/#{widget_name}_widget"
105: raise WidgetNotFound.new("Widget #{widget_name} not found") unless available_widgets.include?(widget_name)
106: end
107: run_behaviour(widget)
108: template_file = search_template widget_name
109: # Add template directory to view_paths, so as to render uses this directory by default
110: self.view_paths.unshift(File.dirname(template_file))
111: render_output = render_to_string :file => File.basename(template_file)
112: self.view_paths.shift
113: render_output
114: end
Disabled; run with $DEBUG to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.