<%= form_tag(save_items_health_phy_exam_tpls_path,method:'post') do %> 这是表单,
def new_options
@phy_exam_tpl = Health::PhyExamTpl.find(params[:id])
end
def save_items
@phy_exam_tpl_item = Health::PhyExamTplItem.new(phy_exam_tpl_id: params[:id],
category_item_id: params[:category_item_id])
if @phy_exam_tpl_item.save
@phy_exam_stand_result = Health::PhyExamStandResult.new(health_phy_exam_stand_result_params)
@phy_exam_stand_result.phy_exam_tpl_item_id = @phy_exam_tpl_item.id
if @phy_exam_stand_result.save
flash[:success]=t("flash.phy_items_add_success")
else
flash[:danger] = t("flash.phy_items_add_failure")
end
else
flash[:danger] = t("flash.phy_items_add_failure")
end
end
def health_phy_exam_stand_result_params
permited=params.require(:health_phy_exam_stand_result).permit(:name,:definition_type,:unit,
:device,:result_type,:normal_max,:normal_min,:result_text,:description)
end