app/controllers/spud/admin/posts_controller.rb in spud_blog-0.8.17 vs app/controllers/spud/admin/posts_controller.rb in spud_blog-0.8.18
- old
+ new
@@ -26,11 +26,11 @@
respond_with @post, :location => spud_admin_posts_path
end
def new
@categories = SpudPostCategory.grouped
- @post = SpudPost.new(:published_at => Time.zone.now, :spud_user_id => current_user.id, :spud_site_ids => [current_site_id])
+ @post = SpudPost.new(:published_at => Time.zone.now, :spud_user_id => current_user.id, :spud_site_ids => [session[:admin_site] || 0])
respond_with @post
end
def create
@categories = SpudPostCategory.grouped
@@ -42,11 +42,11 @@
respond_with @post, :location => spud_admin_posts_path
end
def destroy
if @post.destroy
- flash[:notice] = 'Post was successfully deleted.'
+ flash[:notice] = 'Post was successfully deleted.'
end
respond_with @post, :location => spud_admin_posts_path
end
private
@@ -57,6 +57,6 @@
flash[:error] = "Post not found!"
redirect_to spud_admin_posts_path and return false
end
end
-end
\ No newline at end of file
+end