Just a follow up in case this helps anyone else:
> You could also probably put a literal "" in the error message, then
> use unescape_html.
As it turns out, simple_format was wrapping everything in < p > tags,
which was causing invalid html to be generated in the error view of my
form.
So, I tri
Thanks Jim
On Sep 27, 3:29 pm, Jim Burgess wrote:
> pepe wrote:
> > If you do, please post the solution. I would like to know.
>
> Hi Pepe,
>
> so, after a week of trying I finally found the solution and am posting
> it here in case it helps anyone else.
>
> Error message in model:
>
> errors.add
Jim Burgess wrote:
> pepe wrote:
>> If you do, please post the solution. I would like to know.
>
> Hi Pepe,
>
> so, after a week of trying I finally found the solution and am posting
> it here in case it helps anyone else.
>
> Error message in model:
>
> errors.add(field, "This field is too l
pepe wrote:
> If you do, please post the solution. I would like to know.
Hi Pepe,
so, after a week of trying I finally found the solution and am posting
it here in case it helps anyone else.
Error message in model:
errors.add(field, "This field is too long.\nYou are using
#{self[field].lengt
I have not been able to find a way of breaking the line, except by
breaking the message in 2 separate ones as I explained before. If you
do, please post the solution. I would like to know. Sorry I couldn't
be of much help.
On Sep 21, 5:52 pm, Jim Burgess wrote:
> > First line<%= sanitize('') -%>S
> I tried:
>
> errors.add(:thesis, "This field is too long. <%= sanitize('') -%>
> You are using #{field.length} characters out of a permitted
> #{permitted}.")
>
> This produced:
> "This field is way too long. <%= sanitize('') -%> You are using
> 12600 characters out of a permitted 1000."
>
> In t
> First line<%= sanitize('') -%>Second line
I tried:
errors.add(:thesis, "This field is too long. <%= sanitize('') -%>
You are using #{field.length} characters out of a permitted
#{permitted}.")
This produced:
"This field is way too long. <%= sanitize('') -%> You are using
12600 characters ou
Adding this to a regular page broke the string in 2 lines on the page:
First line<%= sanitize('') -%>Second line
It's not the same thing but it might work?
> The source reads:
>
> This field is too long. & l t ; br /& g t ;You are using 12600
> characters out of a permitted 1000.
>
> (I have put
pepe wrote:
> Have you checked the source to see what was the HTML output?
Thanks for the answer.
The source reads:
This field is too long. & l t ; br /& g t ;You are using 12600
characters out of a permitted 1000.
(I have put spaces between the characters so that they don't get parsed
when I
Never tried it, but I am thinking your first option should work if you
sanitize the whole ''. As you posted it, it might be getting
processed and made useless by Rails. Have you checked the source to
see what was the HTML output?
On Sep 21, 2:57 am, Jim Burgess wrote:
> Is it possible to add a li
10 matches
Mail list logo