报名调整

dev_trainings
cxt 6 years ago
parent 3e7cf794b6
commit f939186ca3

@ -37,6 +37,7 @@ class TrainingsController < ApplicationController
def enroll
@training = current_training || Training.new
@training_title = @training_type == 3 ? "信息技术新工科产学研联盟师资培训班" : "工程教育认证"
end
@ -271,6 +272,7 @@ class TrainingsController < ApplicationController
def find_tag_id
@tag_id = params[:id]
Rails.logger.info("##########TAG_ID:#{@tag_id}")
@training_type = @tag_id == "aeee0601_2019" ? 3 : @tag_id == "ceeaa06_2019" ? 4 : 0
render_404 if @training_type == 0
end
@ -284,6 +286,7 @@ class TrainingsController < ApplicationController
end
def current_training
Rails.logger.info("##########openid:#{session[:wechat_open_id]}, training_type: #{@training_type}")
Training.where(openid: session[:wechat_open_id], training_type: @training_type).first
end

@ -124,7 +124,7 @@
</script>
<% end %>
<div>
<p class="collegeInfo">信息技术新工科产学研联盟师资培训班</p>
<p class="collegeInfo"><%= @training_title %></p>
<%= form_for @training do |f| %>
<p class="subtitle">基本信息</p>
<li class="clearfix infoBar">
@ -141,14 +141,14 @@
<li class="clearfix infoBar">
<span class="left_tag fl">单位</span>
<input type="text" class="right_input" id="userUnit" placeholder="请输入单位名称或者学校"
name="major"
value="<%= @training.major %>"/>
name="school"
value="<%= @training.school %>"/>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">职称</span>
<input type="text" class="right_input" id="userPositional" placeholder="请输入职称"
name="student_id"
value="<%= @training.student_id %>"/>
name="technical_title"
value="<%= @training.technical_title %>"/>
</li>
<% if @training_type == 3 %>

@ -0,0 +1,5 @@
class AddTechnicalTitleToTrainings < ActiveRecord::Migration
def change
add_column :trainings, :technical_title, :string
end
end
Loading…
Cancel
Save