Question about the number_to_phone function as provided by rails in
actionpack:
If I do this in my controller:
num = number_to_phone(params[:phone_number])
I get this error:
undefined method `number_to_phone’ for
#TicketsController:0xb7a2bfcc
Whereas if I do this in my view:
<% phone_number = number_to_phone(@phone_number.phone_number) %>
<%= text_field ‘phone_number’, ‘phone_number’, {
:value => phone_number,
:size => 12, } %>
It works as advertized. Does anyone have any idea why?
Thanks,
Peter
(**********************************************************
- Peter H. Boling
- Web Application Designer - PanEther, LLC
- email: [email protected]
- blog: http://galtzo.blogspot.com/
- languages: English, Spanish, Portuguese
***********************************************************)