Conclusion of Chapter 6
Ok, I’m going to cheat a little bit. :)
I’m going to go to RubyForge and grab the latest version of Ackbar in CVS. The reason for this is because Assaph already has put in a fix for the DateTime issue I had in my last post. Also, he has a fix in for an error that I haven’t mentioned yet: when I would click on “edit” for an existing record on my “Listing products” page, I would get a full screen error stating, “Expecting a list of IDs!”.
Anyway, both of these errors, and the error I posted about a couple of days ago have all been fixed in CVS head, so grab it if you are following along.
Back to Chapter 6. Page 64. I add the validates_presence_of code to the Product class. Switch over to my browser and try to add a new, empty record. I get the three validation errors. Great! I enter data into the fields and click “Create” again. This time Rails adds the new record.
Page 65. I open up the Product class again to add the validates_numericality_of code for :price. I test this and do indeed get an error message when trying to save alphabetic characters in the :price field.
Page 66. I add the validate method in class Product to check for a positive number in :price. I test this and it gives me an error when I attempt to save -123 in :price.
Page 66. I add in the last two validations: uniqueness of :title and format of :image_url. I test for both and they throw errors as expected.
Were making good progress!
Page 67. I make all of the changes to list.rhtml and scaffold.css. I put some images in public images. I switch over to my browser and reload admin/list. Everything looks great.
I click on “Destroy” for one of the records, and the record is deleted. I edit the description of a record, and do a “cat products.tbl” to make sure it is reflected in the database.
By the way, here’s another reason why Ackbar/KirbyBase might be attractive to you. Since KirbyBase tables are simply text files, it’s very easy to open them up and make sure changes you make in a Rails app are properly reflected in the database.
Alright. I’m done with Chapter 6 and, besides a few minor glitches that Assaph has already fixed, Ackbar/KirbyBase passed the test.
On to Chapter 7!
Zmajrsy replied:
http://1.xxxsexygirl69d.info x
June 14, 2007 at 8:24 am. Permalink.
international student travel insurance replied:
international student travel insurance
protectiveness grosses container.distributing,recalculating
June 16, 2007 at 1:17 pm. Permalink.
casinosfreebonusesv replied:
deposit free bonus casino
see to signature…
August 12, 2007 at 4:31 am. Permalink.
freeeeringtones replied:
popular free ringtones
http://www.thehotstop.info
signature…
August 18, 2007 at 3:16 am. Permalink.
european sportsbook replied:
european sportsbook
Brewster bluster,leadership incidence confident?
October 30, 2007 at 3:24 pm. Permalink.
weipsed replied:
ONLINE – DRUGSTORE!
PRICES of ALL MEDICINES!
FIND THAT NECESSARY…
VIAGRA, CIALIS, PHENTERMINE, SOMA… and other pills!
Welcome please: pills-prices.blogspot.com
NEW INFORMATION ABOUT PAYDAY LOANS!
Welcome please: payday-d-loans.blogspot.com
GOOD LUCK!
November 2, 2007 at 5:43 pm. Permalink.
sao cars insurance replied:
sao cars insurance
copyrighted invective foreign?assenter mailing
December 31, 2007 at 10:09 am. Permalink.
vente de jeu de poker replied:
telecharger jeu poker…
VonAnfang le poker en ligne français poker spielen software wo kann man poker spielen video poker online gratis poker game gratis download…
June 2, 2008 at 10:59 am. Permalink.
www casino de paris replied:
www casino de paris…
Officially no deposit bonus online casino deutsche casino online casino jeux de table download free ringtones wwe poker flash on line…
June 30, 2008 at 5:48 pm. Permalink.