Question about the number_to_phone function as provided by
rails in actionpack:
http://api.rubyonrails.org/classes/Action
View/Helpers/NumberHelper.html
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: peter.boling gmail.com
* blog: http://galtzo.blogspot.co
m/
* languages: English, Spanish, Portuguese
***********************************************************)
_______________________________________________
Rails mailing list
Rails lists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
|