当我检查我的错误消息是否正常工作时,我注意到我的重定向在POST(创建
操作)后转到/business
/cusiness/new。我正在使用常规的RESTFUL路由,但我需要它在POST时返回到/business/new
。我该怎么做?
这是我当前的代码:
def create
@business = Business.new(params[:business])
if @business.save
redirect_to :back, :notice => "You have successfully added a new business."
else
render :action => new , :notice => "Please try again."
end
end