[Rails] Re: How do you use :message with validation?

Jean-etienne Durand
Thu, 20 Jul 2006 09:43:39 -0000

<%= error_messages_for(''my_model'') %> in your view.

Some css style examples:
154 	/* error
155 	   ---- */
156 	.fieldWithErrors {
157 	  padding: 1px;
158 	  background-color: red;
159 	  display: table;
160 	}
161 	#errorExplanation {
162 	  border: 2px solid red;
163 	  padding: 7px;
164 	  padding-bottom: 12px;
165 	  margin-bottom: 10px;
166 	  background-color: #f0f0f0;
167 	}
168 	#errorExplanation h2 {
169 	  text-align: left;
170 	  font-weight: bold;
171 	  padding: 5px 5px 5px 15px;
172 	  margin: -7px;
173 	  background-color: #c00;
174 	  color: #fff;
175 	}
176 	#errorExplanation p {
177 	  color: #333;
178 	  margin-bottom: 0;
179 	  padding: 5px;
180 	}
181 	#errorExplanation ul li {
182 	  list-style: square;
183 	}