Created
August 8, 2012 23:00
-
-
Save creativereason/3299581 to your computer and use it in GitHub Desktop.
lead...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Lead < ActiveRecord::Base | |
attr_accessible :address, :city, :company, :email, :job_title, :name, :phone_number, :state | |
validates :name, :presence => true | |
validates :email, :presence => true, :format => { :with => /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]+\z/, | |
:message => "Valid email only" } | |
validates :company, :presence => true | |
end |
This finally spit it out to the console:
<% @lead.errors.full_messages.each do |error_text| %>
console.log("<%= escape_javascript error_text %>");
<% end %>
Did that display the proper text? I'm wondering if maybe they weren't properly escaped?
Yes. I know I had them escaped before. I'll try another option at putting them back on the page.
Thanks.
You might try $('#error_explanation').append('<%=content_tag(:, escape_javascript(msg))%>');
I'm missing the p in the content_tag.
Also the escape_javascript might make sense wrapping the content_tag instead too, I'm not sure.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting this error:
(Referencing that line: