modify training

dev_trainings
p31729568 6 years ago
parent c15546369c
commit 48cf73dbbf

@ -112,6 +112,7 @@ class TrainingsController < ApplicationController
@training.openid = session[:wechat_open_id] @training.openid = session[:wechat_open_id]
@training.save! @training.save!
flash[:message] = '提交成功'
redirect_to enroll_training_path(id: @tag_id) redirect_to enroll_training_path(id: @tag_id)
# redirect_to pay_training_path(id: @tag_id) # redirect_to pay_training_path(id: @tag_id)
end end
@ -130,6 +131,7 @@ class TrainingsController < ApplicationController
end end
@training.save! @training.save!
flash[:message] = '提交成功'
redirect_to enroll_training_path(id: @tag_id) redirect_to enroll_training_path(id: @tag_id)
# redirect_to pay_training_path(id: @tag_id) # redirect_to pay_training_path(id: @tag_id)
end end
@ -252,7 +254,7 @@ class TrainingsController < ApplicationController
def authenticate def authenticate
if Rails.env.development? if Rails.env.development?
# session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM" session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM"
end end
unless session[:wechat_open_id].present? unless session[:wechat_open_id].present?

@ -205,27 +205,27 @@
</li> </li>
<% end %> <% end %>
<p class="subtitle">通讯地址</p> <!-- <p class="subtitle">通讯地址</p>-->
<li class="clearfix infoBar"> <!-- <li class="clearfix infoBar">-->
<!--<div class="clearfix" id="userArea" NavShow>--> <!-- <div class="clearfix" id="userArea" NavShow>-->
<!--<span class="left_tag fl">地区</span>--> <!-- <span class="left_tag fl">地区</span>-->
<!--<input type="text" class="right_input" id="usertitle" placeholder="填写区域"/>--> <!-- <input type="text" class="right_input" id="usertitle" placeholder="填写区域"/>-->
<!--<i class="iconfont icon-youjiantou rightArrow"></i>--> <!-- <i class="iconfont icon-youjiantou rightArrow"></i>-->
<!--</div>--> <!-- </div>-->
<textarea class="DetailAddress" placeholder="请输入详细地址" name="address" id="DetailAdd" style="margin-top: 15px;"><%= @training.address %></textarea> <!-- <textarea class="DetailAddress" placeholder="请输入详细地址" name="address" id="DetailAdd" style="margin-top: 15px;"><%#= @training.address %></textarea>-->
</li> <!-- </li>-->
<li class="clearfix infoBar"> <li class="clearfix infoBar">
<span class="left_tag fl">手机号码</span> <span class="left_tag fl">手机号码</span>
<input type="text" class="right_input" placeholder="请输入手机号" id="userphone" <input type="text" class="right_input" placeholder="请输入手机号" id="userphone"
name="phone" name="phone"
value="<%= @training.phone %>"/> value="<%= @training.phone %>"/>
</li> </li>
<li class="clearfix infoBar"> <!-- <li class="clearfix infoBar">-->
<span class="left_tag fl">Email</span> <!-- <span class="left_tag fl">Email</span>-->
<input type="text" class="right_input" placeholder="请输入Email" id="userEmail" name="email" value="<%= @training.email %>"/> <!-- <input type="text" class="right_input" placeholder="请输入Email" id="userEmail" name="email" value="<%#= @training.email %>"/>-->
</li> <!-- </li>-->
<p style="height: 50px;"></p> <p style="height: 50px;"></p>
<a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();">完成</a> <a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();">提交</a>
<% end %> <% end %>
</div> </div>
@ -248,7 +248,12 @@
} else { } else {
$('#sex').val("2"); $('#sex').val("2");
} }
}) });
var message = "<%= flash[:message] %>";
if (message && message.length > 0) {
alert(message);
}
}) })
//下一步 //下一步

Loading…
Cancel
Save