Sha256: 2734ecdc2bf1cd51079e49e31eb8dd94d598f7f0af268572f94d433626bca617
Contents?: true
Size: 929 Bytes
Versions: 18
Compression:
Stored size: 929 Bytes
Contents
module Brightcontent module BaseHelper def render_list_field(item, field) ViewLookup::ListField.new(self, item: item, field: field).call end def render_filter_field(form, field, options) ViewLookup::FilterField.new(self, field: field, form: form, options: options).call end def render_form_field(form, field) ViewLookup::FormField.new(self, item: form.object, field: field, form: form).call end def render_if_exists(*args) render(*args) rescue ActionView::MissingTemplate nil end # Returns filter field definitions as a nested array. # # [:foo, { bar: { as: :select }, qux: { as: :string } }] # # Becomes: # # [[:foo], [:bar, { as: :select }], [:qux, { as: :string }]] # def normalized_filter_fields filter_fields.flat_map do |field| field.is_a?(Hash) ? field.to_a : [[field]] end end end end
Version data entries
18 entries across 18 versions & 1 rubygems