app/forms/dynamic_product_form.rb
# Define dynamic getters and setters for dynamic fields for each filter
Define dynamic getters and setters for dynamic fields for each filter
Define dynamic getters and setters for dynamic fields for each filter
def add_filter_accessors
    @filters.each do |filter|
      singleton_class.class_eval do
        define_method(filter.field_name) { @attributes[filter.field_name] }
        define_method("#{filter.field_name}=") { |value| @attributes[filter.field_name] = value }
      end
    end
  end
def add_filter_accessors @filters . each do | filter | singleton_class . class_eval do define_method ( filter . field_name ) { @attributes [ filter . field_name ] } define_method ( "#{filter.field_name}=" ) { | value | @attributes [ filter . field_name ] = value } end end end
Define dynamic getters and setters for dynamic fields for each filter
Define dynamic getters and setters for dynamic fields for each filter