UserController.rb
def confirm_complete
logger.info "************** confirm_complete"
@user_info = UserInfo.new(params[:user_info])
@user = User.new(params[:user])
login_id = @user.login
@user.user_info = @user_info
logger.info "00000000000000000000000000000000000000000000000"
if @user.save
logger.info "------------------save-----------------------"
# render(:partial => 'confirm_page')
#render(:text => "confirm_complete")
end
end
向 confirm_complete.html.erb 跳转,跳不过去,谁能帮忙看看是哪里的问题,谢谢
#6 楼 @Rei 对啊,我要的是 render,我看 log 没有报错啊
************** confirm_complete (pid: 5132)
[4;36;1mUserInfo Columns (6.3ms)[0m [0;1mSHOW FIELDS FROM `user_infos`[0m (pid: 5132)
00000000000000000000000000000000000000000000000 (pid: 5132)
[4;35;1mSQL (48.6ms)[0m [0mCOMMIT[0m (pid: 5132)
------------------save----------------------- (pid: 5132)
Rendering template within layouts/flows (pid: 5132)
Rendering user/confirm_complete (pid: 5132)
[4;36;1mSchool Load (1.0ms)[0m [0;1mSELECT * FROM `admins` WHERE (`admins`.`login_code` = 'takeshita') AND (admins.deleted = false) AND ( (`admins`.`type` = 'School' ) ) LIMIT 1[0m (pid: 5132)
[4;35;1mCACHE (0.0ms)[0m [0mSELECT * FROM `admins` WHERE (`admins`.`login_code` = 'takeshita') AND (admins.deleted = false) AND ( (`admins`.`type` = 'School' ) ) LIMIT 1[0m (pid: 5132)
Rendered layouts/_messages (0.0ms) (pid: 5132)
Completed in 389ms (View: 65, DB: 104) | 200 OK [http://localhost/user/confirm_complete] (pid: 5132)
<iframe name="iframe" style="display:none;" width = "10" height="10"></iframe>
<div class="w980">
<p class="path"><a href="#"><%= t('new.application_complete') %></a></p><!--申込完了-->
<h1><%= t('new.application_complete') %></h1><!--申込完了-->
<div class="flows ml20">
<div class="process"> <img src="/user/images/flows/b_step03.jpg" alt='<%= t('new.application_complete') %>'/> </div><!--申込完了-->
<div class="complete">
<div class="note"><%= t("new.order_completed") %></div><!--ご注文が完了いたしました。-->
</div>
</div>
</div>
<div></div>
<h1>111111111111111111111</h1>
</div>
实际上没有跳过去,还是原页面
#14 楼 @waitingaminute 为什么要用 onclick 事件,这个 form 是普通的 form 还是 ajax 提交,用浏览器调试面板 Network 栏看请求情况,发出了什么请求,有没有错误。
#15 楼 @Rei 就是普通 form 提交,network headers 里显示:Request URL:http://localhost:3000/user/confirm_complete Request Method:POST Status Code:200 OK 我要跳转到的页面就是这个 url 的页面