From 48cf73dbbf8f15d8e212121a30d3522c18796b22 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 14 Jun 2019 11:25:20 +0800 Subject: [PATCH] modify training --- app/controllers/trainings_controller.rb | 4 ++- app/views/trainings/enroll.html.erb | 35 ++++++++++++++----------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb index 0668edde..e3e96f11 100644 --- a/app/controllers/trainings_controller.rb +++ b/app/controllers/trainings_controller.rb @@ -112,6 +112,7 @@ class TrainingsController < ApplicationController @training.openid = session[:wechat_open_id] @training.save! + flash[:message] = '提交成功' redirect_to enroll_training_path(id: @tag_id) # redirect_to pay_training_path(id: @tag_id) end @@ -130,6 +131,7 @@ class TrainingsController < ApplicationController end @training.save! + flash[:message] = '提交成功' redirect_to enroll_training_path(id: @tag_id) # redirect_to pay_training_path(id: @tag_id) end @@ -252,7 +254,7 @@ class TrainingsController < ApplicationController def authenticate if Rails.env.development? - # session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM" + session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM" end unless session[:wechat_open_id].present? diff --git a/app/views/trainings/enroll.html.erb b/app/views/trainings/enroll.html.erb index 1362e78f..6b898691 100644 --- a/app/views/trainings/enroll.html.erb +++ b/app/views/trainings/enroll.html.erb @@ -205,27 +205,27 @@ <% end %> -

通讯地址

-
  • - - - - - - -
  • + + + + + + + + +
  • 手机号码
  • -
  • - Email - -
  • + + + +

    - 完成 + 提交 <% end %> @@ -248,7 +248,12 @@ } else { $('#sex').val("2"); } - }) + }); + + var message = "<%= flash[:message] %>"; + if (message && message.length > 0) { + alert(message); + } }) //下一步