I''m still learning and can''t figure out how to get a phone number out of my database and into a pdf document with some standard rails formatting. Specifically, in my controller my "define pdf" method includes: clientphone = "1234567890" pdf.text number_to_phone(clientphone) which generates an error reading undefined method `number_to_phone'' I also tried pdf.text ActionView.number_to_phone(clientphone) which generates the same error. I''m not trying to use a template handler or anything tricky. I create a separate rails application to just output that one string formated as a phone number and it has the same error. Any help appreciated. Thanks, DAN -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I believe I''ve determined that ActionView method can''t go in the controller method. Calling number_to_phone even without using pdf writer creates an error which kind of makes since. No data manipulation can take place in the controller. Now I''m wondering about how to get the number_to_phone result returned to the controller method for output to the pdf file. I''ve been moving my code around so PDF::Writer.new is in a helper but then the send_data command which renders the file creates errors I think because it needs to be strickly in the controller. If I simply move the send_data command out of the helper and back into the controller it needs to receive the returned data to output. Without rendering a view, is returing a result from a helper method to a controller for output suppose to be even possible? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---