app/controllers/spud/admin/posts_controller.rb in spud_blog-0.8.12 vs app/controllers/spud/admin/posts_controller.rb in spud_blog-0.8.13
- old
+ new
@@ -17,34 +17,36 @@
respond_with @post
end
def update
@categories = SpudPostCategory.grouped
+ params[:spud_post][:spud_site_ids] ||= []
if @post.update_attributes(params[:spud_post])
flash[:notice] = 'Post was successfully updated.'
end
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)
+ @post = SpudPost.new(:published_at => Time.zone.now, :spud_user_id => current_user.id, :spud_site_ids => [current_site_id])
respond_with @post
end
def create
@categories = SpudPostCategory.grouped
+ params[:spud_post][:spud_site_ids] ||= []
@post = SpudPost.new(params[:spud_post])
if @post.save
flash[:notice] = 'Post was successfully created.'
end
respond_with @post, :location => spud_admin_posts_path
end
def destroy
if @post.destroy
flash[:notice] = 'Post was successfully deleted.'
- end
+ end
respond_with @post, :location => spud_admin_posts_path
end
private
\ No newline at end of file