Method: Sibu::PagesHelper#widget
- Defined in:
- app/helpers/sibu/pages_helper.rb
#widget(elt, widget_type, opts = {}, &block) ⇒ Object
213 214 215 216 217 |
# File 'app/helpers/sibu/pages_helper.rb', line 213 def (elt, , opts = {}, &block) content = elt.is_a?(Hash) ? elt : (select_element(elt) || {}) opts.merge!({data: {id: elt_id(elt), type: "widget_#{.to_s.split('::').last.underscore}"}}) if action_name != 'show' content_tag(:div, capture(.new(content), &block), opts) end |