Sha256: 99203230edbbfe3ee2af18acfea35efae4dc57bd009d1ea3f8e64d0a309253f4
Contents?: true
Size: 837 Bytes
Versions: 15
Compression:
Stored size: 837 Bytes
Contents
# frozen_string_literal: true module UiComponents class ValidatedOpenStruct < OpenStruct def self.validators_on(*) [] end end module FormHelper # TODO: Move to own component. def modelless_form(options, &block) model_params = options[:params] || params[options[:name]] struct = ValidatedOpenStruct.new(model_params) bootstrap_form_for( struct, as: options[:name], url: options[:url].to_s, method: options.fetch(:method, :post), &block ) end # TODO: Move to DatagridFilterCell or own component. def datagrid_filters(form, filters, options = {}) filter_markup = filters.map do |filter| ui_component(:datagrid_filter, options.merge(form: form, filter: filter)) end safe_join filter_markup end end end
Version data entries
15 entries across 15 versions & 1 rubygems