app/views/projects/_run_estimation.js.erb
$(".securities_user").html("<label><%= I18n.t(:securities)%></label><br />");
$(".securities_user").append("<%= j(
select_tag('project_security_level',
options_for_select(
ProjectSecurityLevel.all.map{|i|[i.name, i.id]},
:selected => @prj_scrt.project_security_level_id),
:prompt => I18n.t('helpers.select.prompt')))
%>");
$(".securities_group").html("<label><%= I18n.t(:securities)%></label><br />");
$(".securities_group").append("<%= j(
select_tag('project_security_level_group',
options_for_select(
ProjectSecurityLevel.all.map{|i|[i.name, i.id]},
:selected => @prj_scrt.project_security_level_id),
:prompt => I18n.t('helpers.select.prompt')))
%>");
$("#project_security_level").change(
function () {
$.ajax({ url:'/update_project_security_level',
data:'project_security_level=' + this.value + '&user_id=' + $("#user_id").val()
})
}
);
$("#project_security_level_group").change(
function () {
$.ajax({ url:'/update_project_security_level_group',
data:'project_security_level=' + this.value + '&group_id=' + $("#group_id").val()
})
}
);