Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

validates_length_of error message pluralization

#6373

The default error message for validates_length_of is "is too short (minimum is %{count} characters)". This causes incorrect pluralization for edge cases :minimum => 1 and :in => 1..10.

This is not a simple fix in the validation method because the messages are static text pulled from the i18n YAML files. Instead I have added a paragraph to the guides to raise the issue and suggest that developers use validates_presence_of or send a personalized message instead.

Patch attached.

Reported by Kevin Skoglund · February 4th, 2011 @ 04:05 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to resolved
    • Importance changed from to Low

    Can you please patch this directly in github.com/lifo/docrails is the official place for doc patches :)

    February 4th, 2011 @ 10:27 PM

  2. Kevin Skoglund
    Kevin Skoglund

    Thanks. Patched in github.com/lifo/docrails.

    February 7th, 2011 @ 02:25 PM