From aa5adc62242f91f3cf7316deaf04b4b8d8d1b959 Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Fri, 11 Apr 2008 16:01:58 +0000 Subject: [PATCH] ActionItem266: add link to back to parent category --- app/views/manage_products/_subcategories.rhtml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/manage_products/_subcategories.rhtml b/app/views/manage_products/_subcategories.rhtml index 569cf88..1a4b1c8 100644 --- a/app/views/manage_products/_subcategories.rhtml +++ b/app/views/manage_products/_subcategories.rhtml @@ -1,10 +1,15 @@

<%= _('Current category:') %>

-<%= hidden_field_tag 'product[product_category_id]', @current_category.id %> +<%= hidden_field_tag 'product[product_category_id]', @current_category ? @current_category.id : nil %> <% categories = [@current_category] categories.push(@current_category) while @current_category and @current_category = @current_category.parent %> -<%= categories.compact.reverse.map{|i| link_to(i.name, {}, :class => 'select-current-category-link')}.join(' → ') %> +<%= categories.compact.reverse.map{|i| + link_to_remote(i.name, + :update => "subcategories", + :url => { :action => 'update_subcategories', :id => i, :loaded => visual_effect(:highlight, "subcategories") }, + :class => 'select-current-category-link')}.join(' → ') +%> <% unless @categories.empty? %>

<%= _('Select a subcategory:') %>

-- libgit2 0.21.2