search for: payment_types

Displaying 6 results from an estimated 6 matches for "payment_types".

2006 Jul 12
5
DRY version of RoR book PAYMENT_TYPES example
In the book there is an example how to convert DB payment value to more readable from. PAYMENT_TYPES array is defined and then in your views you can use it as Order::PAYMENT_TYPES. The problem is: how should I convert DB values (for example with type char(1)) to full string representation. I know that I can add a Hash to a model: IM = {''S'' => ''Skype'', ...
2006 Jan 28
1
Collection_select problem
I have my customer object with title attribute : @customer.title Where title is "Mr","Mrs", etc.... In edit/create from i have: @titles=["Mr","Mrs","Miss"] how do i create a selection box that sets itself to the value of @customer.title?? This doesn''t work: <%=collection_select(:customer, :title, @titles)%> Any help would be
2006 Nov 07
1
reading VERY large binary files
Hello, I am trying to read in elements out of a very large binary file ... the total file is 4 gigs. I want to select rows out of the file, and the current procedure I run works but is prohibitively slow (takes more than a day to run and still won't complete). Is there any faster way to accomplish this? My current procedure looks like this: readHH <- function(file_name,
2006 Aug 08
1
limit user input for legacy coding schemes
The legacy db I am currently working with has lots of codes (2 character strings) that are required to be the same in the new version of the app. Things like country codes, language codes and others which are not standard. Rather than create a table for each and then have a relationship between my models, I would much prefer to have a string field in the model being tagged with a code, limit
2009 Feb 26
1
composed_of, aggregate object isn't saved
I am relatively new to rails and I cannot figure out what is going on here. I am using the composed_of method in an ActiveRecord class to create two aggregate properties: shipping_address and billing_address. The object properties are getting populated from the form and validation is working - no problem. When I call order.save, though, everything is being saved except the address fields. I am not
2009 Mar 31
3
serving xml
Hi All, I''m trying to serve some XML from my Rails 2.0 server. I have a Flash file that always reads its configuration from /home/gallery.xml So, I would like to build the contents from the database and serve it back to the flash file when it hits my xml url. If it was HTML that it was asking for then in my home controller I have a gallery method that serves back a gallery.html.erb