Hello,
I wrote the following helper:
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
end
end
When included in a view this helper causes the entire view to be
rendered once and output twice. If I put a break statement after
the concat method, it works as expected.
So my question is, where did the other binding come from?
Most of my information regarding helpers comes from:
Thanks,