In iteration D.1 on page 109 I am not getting a styled error message box
displayed at the top of the checkout as described in the tutorial and I
cannot seem to discover where I have erred.
The scaffold.css is copied from the pragmatic programmers site:
#--------------------------------------------------------------------
$ cat public/stylesheets/scaffold.css
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
.fieldWithErrors {
padding: 2px;
background-color: red;
display: table;
}
#ErrorExplanation {
width: 400px;
border: 2px solid #red;
padding: 7px;
padding-bottom: 12px;
margin-bottom: 20px;
background-color: #f0f0f0;
}
#ErrorExplanation h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
background-color: #c00;
color: #fff;
}
#ErrorExplanation p {
color: #333;
margin-bottom: 0;
padding: 5px;
}
#ErrorExplanation ul li {
font-size: 12px;
list-style: square;
}
/* START:css */
.ListTitle {
color: #244;
font-weight: bold;
font-size: larger;
}
.ListActions {
font-size: x-small;
text-align: right;
padding-left: 1em;
}
.ListLine0 {
background: #e0f8f8;
}
.ListLine1 {
background: #f8b0f8;
}
/* END:css */
#-----------------------------------------------------------------------------
The code in app/views/layouts/store.rhtml produces this in the browser
display:
#-----------------------------------------------------------------------------
Harte & Lyne Limited - Depot Demo #-----------------------------------------------------------------------------The app/views/store/checkout.rhtml produces this:
#-----------------------------------------------------------------------------
4 errors prohibited this order from being saved
There were problems with the following fields:
- Name can't be blank
- Pay type can't be blank
- Address can't be blank
- Email can't be blank
#------------------------------------------------------------------------------
But the DOM inspector in Firefox shows this:
No styles defined
Click on tag to toggle stickyness
4 errors prohibited this order from being saved
There were problems with the following fields:
-
Name can’t be blank
-
Pay type can’t be blank
-
Address can’t be blank
-
Email can’t be blank
#------------------------------------------------------------------------------
This is telling me that the styles that error_messages_for is expecting
are not provided by the stylesheet. Can anyone tell me why?
Regards,
Jim