The scaffold generator takes a model name, followed by an optional 
space-delimited list of field name:type specs.  So you might say:

  script/generate scaffold Book name:string description:text price:decimal

Or you can leave off the list of field names (in which case you don't get much 
in your views or the migration).

But the generator doesn't know what to do with that trailing "Manage".

Note that since you already have a table created, you'll likely want to delete 
the migration that the scaffold generator creates for you.

Also--bonus unsolicited advice: you're best off using the exact version of 
rails that your author specifies.

HTH,

-Roy

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of seafront
Sent: Tuesday, February 16, 2010 3:55 AM
To: Ruby on Rails: Talk
Subject: [Rails] wrong number of arguments (Wrox Beginning Ruby On Rails)

I'm reading a book "Beginning Ruby on Rails"
I made an table, and tried to make an Model class. But it doesn't work.

I made the table as below.

mysql> show columns from books ;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| name        | varchar(80)  | NO   |     | NULL    |                |
| description | text         | NO   |     | NULL    |                |
| price       | decimal(8,0) | NO   |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
4 rows in set (0.07 sec)


I typed to make an model class as below.

G:\web_apps\library>ruby script/generate scaffold Book Manage
      exists  app/models/
      exists  app/controllers/
      exists  app/helpers/
      exists  app/views/books
      exists  app/views/layouts/
      exists  test/functional/
      exists  test/unit/
      exists  test/unit/helpers/
      exists  public/stylesheets/
wrong number of arguments (1 for 2)

--
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


GHC Confidentiality Statement

This message and any attached files might contain confidential information 
protected by federal and state law. The information is intended only for the 
use of the individual(s) or entities originally named as addressees. The 
improper disclosure of such information may be subject to civil or criminal 
penalties. If this message reached you in error, please contact the sender and 
destroy this message. Disclosing, copying, forwarding, or distributing the 
information by unauthorized individuals or entities is strictly prohibited by 
law.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to