2

i have three select list fill with collect, but from same "product" table:

    <p>
            <span>Categoria:</span><%= select :search, :search1, [["Seleccionar", "none"]] + Product.all(:group => "category", :order => "category").collect {|a| [a.category, a.category]} %>
          </p>
           <p>
           <span>Subcategoria:</span><%= select :search, :search2, [["Seleccionar", "none"]] + Product.all(:group => "subcategory", :order => "subcategory").collect {|b| [b.subcategory, b.subcategory]} %>
           </p>
            <p>
            <span>Subcubategoria:</span><%= select :search, :search3, [["Seleccionar", "none"]] + Product.all(:group => "subsubcategory", :order => "subsubcategory").collect {|c| [c.subsubcategory, c.subsubcategory]} %>
</p>

so i like dependent each other.

any idea please?

corona
  • 21
  • 2

1 Answers1

0

Your question is a little bit confusing, but if you want some of the select boxes to update based on the selections in previous select boxes then look up observe_field (and the methods for replicating its behaviour in Rails 3) for some guidance.

Community
  • 1
  • 1
Matt
  • 13,948
  • 6
  • 44
  • 68