From a77b106cbc14f3be727ddd6f6e41c244ca32c9bf Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Wed, 16 Jul 2014 12:02:21 -0300 Subject: [PATCH] Fixing bug AI3206: saving profile categories --- app/controllers/my_profile/cms_controller.rb | 2 +- app/controllers/my_profile/profile_editor_controller.rb | 2 +- app/views/shared/update_categories.js.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 0a00238..f786266 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -232,7 +232,7 @@ class CmsController < MyProfileController @current_category = Category.find(params[:category_id]) @categories = @current_category.children end - render :template => 'shared/update_categories', :locals => { :category => @current_category } + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'article' } end def publish diff --git a/app/controllers/my_profile/profile_editor_controller.rb b/app/controllers/my_profile/profile_editor_controller.rb index 151b01e..3ee21a3 100644 --- a/app/controllers/my_profile/profile_editor_controller.rb +++ b/app/controllers/my_profile/profile_editor_controller.rb @@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController @current_category = Category.find(params[:category_id]) @categories = @current_category.children end - render :template => 'shared/update_categories', :locals => { :category => @current_category } + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'profile_data' } end def header_footer diff --git a/app/views/shared/update_categories.js.erb b/app/views/shared/update_categories.js.erb index 65602ed..8602e6c 100644 --- a/app/views/shared/update_categories.js.erb +++ b/app/views/shared/update_categories.js.erb @@ -1,5 +1,5 @@ <% content = render :partial => 'shared/select_categories', - :locals => {:object_name => 'article', :multiple => true}, :layout => false + :locals => {:object_name => object_name, :multiple => true}, :layout => false %> jQuery('#select-categories').html('<%= j(content) %>'); -- libgit2 0.21.2