Module: Pageflow::Admin::WidgetsHelper
- Defined in:
- app/helpers/pageflow/admin/widgets_helper.rb
Overview
Instance Method Summary collapse
- #admin_widget_types_collection_for_role(config, role) ⇒ Object
- #admin_widgets_fields(form, config) ⇒ Object
Instance Method Details
#admin_widget_types_collection_for_role(config, role) ⇒ Object
11 12 13 14 15 |
# File 'app/helpers/pageflow/admin/widgets_helper.rb', line 11 def (config, role) config..find_all_by_role(role).each_with_object({}) do |, result| result[I18n.t(.translation_key)] = .name end end |
#admin_widgets_fields(form, config) ⇒ Object
4 5 6 7 8 9 |
# File 'app/helpers/pageflow/admin/widgets_helper.rb', line 4 def (form, config) render('pageflow/admin/widgets/fields', widgets: form.object..resolve(config, include_placeholders: true), form: form, config: config) end |