Commit a77b106cbc14f3be727ddd6f6e41c244ca32c9bf

Authored by Arthur Esposte
1 parent aa847970

Fixing bug AI3206: saving profile categories

app/controllers/my_profile/cms_controller.rb
@@ -232,7 +232,7 @@ class CmsController < MyProfileController @@ -232,7 +232,7 @@ class CmsController < MyProfileController
232 @current_category = Category.find(params[:category_id]) 232 @current_category = Category.find(params[:category_id])
233 @categories = @current_category.children 233 @categories = @current_category.children
234 end 234 end
235 - render :template => 'shared/update_categories', :locals => { :category => @current_category } 235 + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'article' }
236 end 236 end
237 237
238 def publish 238 def publish
app/controllers/my_profile/profile_editor_controller.rb
@@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController @@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController
54 @current_category = Category.find(params[:category_id]) 54 @current_category = Category.find(params[:category_id])
55 @categories = @current_category.children 55 @categories = @current_category.children
56 end 56 end
57 - render :template => 'shared/update_categories', :locals => { :category => @current_category } 57 + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'profile_data' }
58 end 58 end
59 59
60 def header_footer 60 def header_footer
app/views/shared/update_categories.js.erb
1 <% 1 <%
2 content = render :partial => 'shared/select_categories', 2 content = render :partial => 'shared/select_categories',
3 - :locals => {:object_name => 'article', :multiple => true}, :layout => false 3 + :locals => {:object_name => object_name, :multiple => true}, :layout => false
4 %> 4 %>
5 jQuery('#select-categories').html('<%= j(content) %>'); 5 jQuery('#select-categories').html('<%= j(content) %>');