diff options
Diffstat (limited to 'app/controllers/admin/blog/posts_controller.rb')
-rw-r--r-- | app/controllers/admin/blog/posts_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb index dbf13b2..2b124ba 100644 --- a/app/controllers/admin/blog/posts_controller.rb +++ b/app/controllers/admin/blog/posts_controller.rb @@ -1,7 +1,8 @@ module Admin module Blog class PostsController < Admin::BaseController - + before_filter :check_category_ids, :only => :update + crudify :blog_post, :title_attribute => :title, :order => 'published_at DESC' @@ -85,6 +86,10 @@ module Admin def find_all_categories @blog_categories = BlogCategory.find(:all) end + + def check_category_ids + params[:blog_post][:category_ids] ||= [] + end end end end
\ No newline at end of file |