All pastes #31313 Raw Edit

Something

public ruby v1 · immutable
#31313 ·published 2005-11-26 14:16 UTC
rendered paste body
module SelectProductHelper  def select_product(object, method, products, options = {})    html = ''    brands = {}    products.each do |p|      if brands[p.brand_id] == nil        brands[p.brand_id] = p.brand.name      end      html<< content_tag('option', "#{brands[p.brand_id]} - #{p.name}", {:value => p.id})    end    Binding.of_caller do |binding|      concat(content_tag('select', html, {'name' => "#{object}[#{method}]"}), binding)    end  endend