You can create a drop-down list using the collection_select helper and when you select a value in one folder, you can send an ajax request back to your controller action to refresh another page element with a new drop-down list and products, for example
<%= collection_select(:category, :some_category_method_name,
Category.all, :id, :category_name,
{:prompt => 'Select'},
{ :onchange => remote_function(:url => {:action => 'get_products'},
:with => "'id=' + this.value")})
%>
<div id='product_dropdown'></div>
, , , , 'get_products' . "product_dropdown" , .
def get_products
@category = Category.find(params[:id)
render :update do |page|
page.replace_html 'product_dropdown',
:partial => 'partial_name_in_which_you_have_product_drop_down',
:locals => {:products => @category.products}
end
end
, .
, collection_select,