def update_param
verify_post_request
access_denied unless has_role?(:profileadmin)
- require_parameters :profile_id, :param_id, :active_rule_id, :value
+ require_parameters :profile_id, :param_id, :active_rule_id
profile = Profile.find(params[:profile_id].to_i)
rule_param = RulesParameter.find(params[:param_id].to_i)
active_rule = ActiveRule.find(params[:active_rule_id].to_i)
active_param = nil
java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, nil, current_user.name)
end
- # let's reload the active rule
+
+ # let's reload the active rule
active_rule = ActiveRule.find(active_rule.id)
render :partial => 'rule', :locals => {:profile => profile, :rule => active_rule.rule, :active_rule => active_rule}
end
<td class="form-key-cell"><%= parameter.name -%></td>
<td class="form-val-cell">
- <form onsubmit="$j.ajax({ url: '<%= ApplicationController.root_context -%>/rules_configuration/update_param/<%=active_param_id-%>?active_rule_id=<%=active_rule_id-%>¶m_id=<%=parameter.id-%>&profile_id=<%=profile.id-%>',
+ <form onsubmit="$j.ajax({ url: '<%= ApplicationController.root_context -%>/rules_configuration/update_param/<%=active_param_id-%>?active_rule_id=<%=active_rule_id-%>¶m_id=<%=parameter.id-%>&profile_id=<%=profile.id-%>',
type:'post',beforeSend: function(request){$j('#param_loading_<%=parameter.id-%>').show();$j('#error_<%=parameter.id-%>').hide();},
data: $j(this).serialize(),
success: function(htmlSuccess){$j('#rule_<%=rule.id-%>').replaceWith(htmlSuccess);},
<span id="text_<%= parameter.id -%>"><%= param_value_input(parameter, param_value, :disabled => read_only) -%></span>
<% unless read_only %>
- <%= submit_tag message('update_verb') %>
+ <%= submit_tag(message('update_verb'), :id => 'submit_' + parameter.id.to_s) %>
<img src="<%= ApplicationController.root_context -%>/images/loading.gif" style="display:none;" id="param_loading_<%= parameter.id -%>">
<% if active_parameter and active_parameter.errors.size>0 %>
<span class="error"><%= active_parameter.errors.on 'value' %></span>