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.

number_to_phone helper doesn't work with 7 digits

#2176

I would expect number_to_phone to work for 7 digits, but it seems that it requires at least 8.


number_to_phone(8005551234) # => 800-555-1234
number_to_phone(5551234)    # => 5551234

I've attached a test to verify the above behavior.

Reported by Ryan · March 9th, 2009 @ 03:55 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Ryan
    Ryan
    • Tag changed from actionpack, actionview, bug to actionpack, actionview, bug, patch

    Here's the proposed patch with updated tests.

    March 9th, 2009 @ 03:57 AM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [1ab2ff58eddee8ac523624dd097424f9a760ad8b]) Fixed number_to_phone to work with 7 digit numbers [#2176 number_to_phone helper doesn't work with 7 digits state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    March 9th, 2009 @ 01:30 PM