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。我怎样才能隐藏它?