similar to: gsub no workie

Displaying 20 results from an estimated 1000 matches similar to: "gsub no workie"

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 Mar 06
2
is "alias" reserved?
I''m playing with an online store.... I have an orders table which holds orders (pricing, statuses, etc). An orderDetails table which holds detailed line items (itemNumbers, unit prices, etc). Each order can have multiple shipping addresses, so I also have an addressbook table. Each orderDetail is tied to an addressbook entry via the ordernumber and addressbook alias, but this
2010 Jan 21
2
Help with correct text file syntax EXCLUDE/INCLUDE + OPTION
Hi, Linux-Ubuntu here. English is not my first language. The man rsync is difficult to understand. I want to backup some folders recursively and some files, see [1] in my /home dir to an external USB HD (Ext4). I want to use a text file for the purpose. [1] /home/user/Documents /home/user/Software /home/user/.evolution/addressbook/local/system/addressbook.db
2007 Dec 15
2
Reading Model data before update
Hi all, here is the challenge: I have this validation method, that basically prevents an object which billed = true to be updated: def before_update if read_attribute(:billed) errors.add_to_base(''This service has already been billed for'') end !read_attribute(:billed) end The above code does not work in case I do something like: object =
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 Feb 08
5
Mysql::Error: Lost connection to MySQL server during query:
Hi, I am having Mysql connection problem for my first AddressBook application (which I took it from http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/) I have gem installed the latest ruby, rails, lighttpd, fastcgi, mysql-4.1.14 on linux. Everything looks good. When I do: mysql -h localhost -u test -ptest -D AddressBook mysql> SELECT COUNT(*) FROM contacts; +----------+ |
2007 Jan 04
6
after_update attributes problem
Hey guys, I''m having a hard time w/ the after_update callback on rails... As far as I can tell, when I define a after_update callback on a model, the attributes of the object have the same values that they had *before* Base.save was called. I''m probably wrong so here''s the code: UNIT TEST: def test_register_item_adjusts_account_balance account =
2006 Feb 22
3
after_update: old, new values?
With after triggers in Postgres, there are special NEW and OLD vars accessible to trigger functions. Any such thing in Rails? Or would it entail doing something like setting a class var in before_update? Jack -- Posted via http://www.ruby-forum.com/.
2004 Nov 07
2
Symlink file syncing issue
Hi! I've been attempting to use rsync to sync a set of files between my laptop and my desktop. I've tried using google to search the archives, but didn't find anything that addressed this issue exactly... First of all, here are the details of how I have things set up. Server acting as the intermediary: OS: Mac OS X Server 10.3 rsync: 2.6.2 Laptop: OS: Mac OS X 10.3.6 rsync: 2.6.2
2019 Mar 11
3
thunderbird addressbook with samba AD
Hi I am trying to make thunderbird addressbook works with my samba AD but with no success. I tried many articles about this but none of them work with my config. Does anybody made it with success ? Marius
2006 Jun 23
10
Don''t un-admin the last administrator
I have a User class with a field called admin which is a boolean that determines if the user is or is not an administrator. I want to make it impossible for the last administrator for an account to be removed from the system. I need to protect against this both when deleting a user and when editing a user as you can revoke a user''s administrator privileges via a form. User
2003 Aug 20
1
including file from excluded directory
I'm trying to explicitly include a file that exists under a directory that I otherwise want excluded. Here are my command and include list: rsync -e ssh -Cavz --delete --update \ --include-from=$HOME/.rsync.laptop . $DEST: where $DEST contains the remote machine name and this is being run from the top of my home directory. My include list is: + /.addressbook + /.ICAClient +
2008 May 10
4
from RubyCocoa to wxRuby ?
hey all, thanks to alex who help me to get the latest running on my box ( Mac OS X 10.4.11) to get it working download the latest gem locally cd to the directory where it lies and : $ sudo gem install --local wxruby u''ll get : Successfully installed wxruby-1.9.7-universal-darwin-9 1 gem installed ;-) A question, my first test will be to convert a RubyCocoa project into wxRuby. this
2006 Feb 17
5
getting old values
Hi all, I''ve add :before_update event to my model Before updating a record I want to check if new attributes differ to old attr. My question is how to retrieve old attributes in :before_update event ? thanks -- gratis egold 1$ http://shegold.com/
2008 Dec 23
2
rails 2.2 connection to MySQL
I have been trying to connect to MySQL thru rails. Initially I had rails 2.1.2 and upgraded to rails 2.2 to use RestAPI in sproutcore. Once I have upgraded my rails version to 2.2, I have been getting this error. All I did is the following: 1. rails addressbook 2. cd addressbook 3. script/generate scaffold Contact first_name:string lastname:string 4. rake db:migrate I also change the
2000 Jun 11
1
NFS Quotas and Samba 2.0.7
Hello everyone! I am currently running Samba 2.0.7 on a RedHat Linux 6.1 box. My user home directories on this box are NFS mounted from another server. Quotas have been enabled on this server and rpc.rquotad is running. On Linux, I can see the user's quotas via a quota -v <username> :- testing:~# quota -v try Disk quotas for user try (uid 1006): Filesystem blocks quota
2006 Jun 28
3
how do I validate currency format if I am storing in cents?
Hi all - To avoid floating point issues, I''ve decided to store monetary values in cents in the database. However, the user will enter these in dollars and cents. Two questions: 1) How do I do the validation for the currency format? It looks like ActiveRecord truncates the cents since it thinks the field type is a Fixnum. Am I forced to do validation in the controller? 2) Where
2008 Feb 07
3
Matching "+" characters in dial plan
Can someone please explain how to match a + character in a dial plan (so that I can swap it for the "00" country escape code). In Europe at least the + is a common shortcut for the international prefix (which is "00" in my country). However, my trunk chokes on the + character and all my speed-dials are setup with a + at the start of them... Trying to fix the phone rather
2006 Jul 06
1
<model>.update(...) not calling before_update callback.
Hi, I''m doing a <model_name>.update(....) but I''m noticing that my before_update callback is not being called. If I do a find and then a save!, I notice that it is called. The problem with a find and save in my case is that I''m not able to set all my attributes in one shot by saving params["user"] and since I can''t do this, my overloaded
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