flash[:notice] = '操作错误!' and redirect_to params[:rt] if topic.nil? flash[:notice] = '操作错误 1!' and redirect_to params[:rt] if topic1.nil? flash[:notice] = '操作错误 2' and redirect_to params[:rt] if topic2.nil?
以上代码不符合 RUBY 的优雅设计
redirect_to params[:rt] 用了 3 次,大家有什么好的代码编写方法?