search for: phone_before_type_cast

Displaying 5 results from an estimated 5 matches for "phone_before_type_cast".

2006 Apr 18
12
Formatting data drawn from a DB
Question for all: Right now i have a Table in a mySQL DB that has a row called Ingredients. When the data is entered into the DB its enter like so from a text area: 1 1/2 lbs. beef top sirloin, thinly sliced 1/3 cup white sugar 1/3 cup rice wine vinegar 2 tablespoons frozen OJ concentrate 1 teaspoon salt 1 tablespoon soy sauce 1 cup long grain rice 2 cups water 1/4 cup cornstarch 2 teaspoons
2006 Apr 21
11
Phone Numbers in Rails/MySQL
Is there any easy way to make a fancy looking form to take phone numbers. Something that looks like this: [ ] - [ ] - [ ] ext: [ ] Then when you submit it it''s combined into one string in the database. Optimally it would auto-switch from field-to-field after you fill each field. Has anyone seen anything like this in Rails? Thanks, Adam -- Posted via
2006 May 09
11
model filter?
Hi All, Is there a way to filter / modify the output of a model class before it''s returned to controller/view that''s calling it? Example: I have a field phone_number which I always want to preformat using the number_to_phone() helper.... Any help is appriciated. Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Jul 11
17
[Best Practices] phone numbers??
I''ve seen phone numbers handled many different ways. Is there a recommended Rails way to store, format and display phone numbers? I''d appreciate comments from the community on this. 1. Is it better to store phone number as a 10-digit string? Then format it as desired when displaying it? 2. or, is it better to store with formatting, ie. "(222) 111-2222" ? 3. Is
2006 May 08
4
gsub no workie
Don''t know why, but cant seem to get this to work for me. I have a phone number field for an addressbook. In the addressbook model I have a before_update declaration that says the following: I''d like to be able to remove all special characters (just numbers please), but this doesn''t want to work for me. before_update :format_phone def format_phone self.phone =