Module: Enjoy::Admin::EmbeddedElement
- Defined in:
- lib/enjoy/admin/embedded_element.rb
Class Method Summary collapse
Class Method Details
.config(_navigation_label = I18n.t('enjoy.cms'), fields = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/enjoy/admin/embedded_element.rb', line 4 def self.config( = I18n.t('enjoy.cms'), fields = {}) Proc.new { # navigation_label(_navigation_label) unless _navigation_label.nil? field :enabled, :toggle field :name, :string fields.each_pair do |name, type| if type.nil? field name else if type.is_a?(Array) field name, type[0], &type[1] else field name, type end end end if block_given? yield self end } end |