1
我想改善我的代碼在控制器根據DRY。DRY在控制器
def create
blog.user = current_user
blog.save
respond_with blog, location: user_root_path
end
def update
blog.update(blog_params)
respond_with blog, location: user_root_path
end
def destroy
blog.destroy
respond_with blog, location: user_root_path
end
每種方法都有一個respond_with博客,位置:user_root_path。我怎樣才能隱藏它?