Sha256: 263d5d7dc3513d1494f8715f98e77a9fe2c580e20a5318f98231164dd54e8012

Contents?: true

Size: 1.21 KB

Versions: 59

Compression:

Stored size: 1.21 KB

Contents

mark_all_input_fields_valid();
<% if (defined?(resource) != nil) && !resource.nil? %>
	<% if resource.errors.size > 0 %>
	<% resource.errors.each do |attrib,message| %>
		<% if attrib =~ /recaptcha/ %>
			show_modal_error_message("<%= escape_javascript(message) %>");
		<% else %>
			var resource_name = "<%= resource.class.name.underscore %>";
			var attribute_name = "<%= attrib %>";
			var field_id = resource_name + "_" + attribute_name;
			var message = "<%= message.html_safe %>";
			//invalidate_input_field internally checks to see if the field exists, otherwise it internally calls show_modal_error_message to show the error in the callout box above the form fields.
			//this currently happens when errors are returned on additional_login_param, which as a field never exists.
			invalidate_input_field(field_id,"<%= message.html_safe %>");
		<% end %>
	<% end %>
	<% end %>
<% end %>
//this conditions happens if an errors variable has been explicitly passed to this errors modal.
//currently this is only done when a ActionController::RoutingError is raised , that too at the moment via the not_found def in the otpcontroller.
<% if (defined?(errors) != nil) %>
	show_modal_error_message("<%= errors[0].to_s %>");
<% end %>

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.9 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.8 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.7 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.6 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.5 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.4 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.3 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.2 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.1 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.5.0 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.9 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.8 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.7 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.6 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.5 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.4 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.3 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.2 app/views/auth/modals/_resource_errors.js.erb
wordjelly-auth-1.4.0 app/views/auth/modals/_resource_errors.js.erb