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 232 @current_category = Category.find(params[:category_id])
233 233 @categories = @current_category.children
234 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 236 end
237 237  
238 238 def publish
... ...
app/controllers/my_profile/profile_editor_controller.rb
... ... @@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController
54 54 @current_category = Category.find(params[:category_id])
55 55 @categories = @current_category.children
56 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 58 end
59 59  
60 60 def header_footer
... ...
app/views/shared/update_categories.js.erb
1 1 <%
2 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 5 jQuery('#select-categories').html('<%= j(content) %>');
... ...