Ruby rails 页面跳转(render和redirect_to)
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实现的是
下载地址
用户评论