1. 首页
  2. 数据库
  3. 其它
  4. Ruby rails 页面跳转(render和redirect_to)

Ruby rails 页面跳转(render和redirect_to)

上传者: 2021-01-04 06:01:43上传 PDF文件 52.28KB 热度 5次
Ruby代码 代码如下:if @user.update_attributes(:password => params[:user][:password]) flash[:notice] = ‘密码修改完成’ redirect_to :action => ‘index’ else redirect_to :action => ‘change_pass’, :id => @user end后来随手改了下第5行,把redirect_to改为render,居然就OK了。网上找了下才发现redirect_to和render还是有很多区别的,我以前居然一点都没有注意,汗.. redirect_to实现的是
下载地址
用户评论