render和redirect的区别在于:
render 没有执行相对应的controller方法!而redirect_to 则重新执行controller方法,也就是说redirect_to 让浏览器去创建一个新的请求。
render 其参数是有效的(有重复提交问题),而redirect_to 其参数是重新请求的。
render vs redirect
最新推荐文章于 2023-03-05 21:01:10 发布
render和redirect的区别在于:
render 没有执行相对应的controller方法!而redirect_to 则重新执行controller方法,也就是说redirect_to 让浏览器去创建一个新的请求。
render 其参数是有效的(有重复提交问题),而redirect_to 其参数是重新请求的。