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 error when using 7 digits and :area_code => true

#6414

When using number_to_phone with a seven digit number and using :area_code => true, I get

TypeError: can't convert nil into String

number_to_phone(5551234, {:area_code => true})

I've attached the following test to confirm.

Reported by PJ Davis · February 11th, 2011 @ 07:03 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. PJ Davis
    PJ Davis
    • Tag changed from actionpack, actionview, bug, helpers to actionpack, actionview, bug, helpers, patch

    Here is the proposed patch and updated test.

    February 11th, 2011 @ 07:08 PM