Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > BOOK: Beginning Ruby on Rails
BOOK: Beginning Ruby on Rails
This is the forum to discuss the Wrox book Beginning Ruby on Rails by Steve Holzner Ph.D.; ISBN: 9780470069158
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Ruby on Rails section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 17th, 2009, 09:53 AM
Registered User
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Originally Posted by Jim_in_Germany View Post

To get the store (chpt. 6) up and running with Rails 2.x, you need to do the following:

Don't create the sql databases as instructed, instead change to your rubydev directoy (or wherever you are storing your rails projects) and type:
rails store
change to the store directory (eg with cd store)

ruby script/generate scaffold Item name:string description:text price:float
Then edit the config/database.yml file, adding your sql password where appropriate.

Then back to the console and type:
rake db:create:all
rake db:migrate
That's it.
You have created a model called "Item", a database table in store_development called "items" and a controller called "ItemController"

You can add records to the database under the url:

The rest should be straight forward.
Hope this helps somebody.

P.S. Running Rails 2.x, MySQL version 5.x and Ubuntu Linux
Hello, i followed these steps, but i really need your help: i got the error
Action Controller: Exception caught body { background-color: #fff; color: #333; } body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; font-size: 11px; } a { color: #000; } a:visited { color: #666; } a:hover { color: #fff; background-color:#000; } NoMethodError in ItemsController#index

undefined method `paginate' for #<ItemsController:0x3ad545>what's wrong, or what should i do? the rails version i'm using is 2.2.2
Old February 16th, 2010, 03:28 AM
Registered User
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanks jim

thanks a lot jim

it work for me even i am using ruby 2.2

great man keep it up........................
Old August 13th, 2010, 11:20 PM
Registered User
Join Date: Aug 2010
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Default Building app set to MySQL

Thanks Jim for the great instructions.

It's also worth noting that you can default to MySQL by creating your app with the following, saving .yml cleanup time.
$ rails -d mysql store
Best of luck.

Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 6: scaffold syntax error cwhite124 BOOK: Beginning Ruby on Rails 1 January 3rd, 2008 07:20 AM
Can someone see what i did wrong here chapter 6 amo BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 April 8th, 2004 01:12 PM
Is Chapter 13 Code wrong??? miggitty VB.NET 2002/2003 Basics 0 December 31st, 2003 12:20 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.