[前][次][番号順一覧][スレッド一覧]

rails:500

From: Stoyan Zhekov <stoyan@g...>
Date: Mon, 31 Oct 2005 11:05:43 +0900
Subject: [rails:500] Re: generate scaffold ができません

On 10/31/05, Hiroyuki Adachi <adachi@t...> wrote:
> $ ruby script/generate scaffold user Users
>                                      =====
>                            これがポイントなんでしょうか?

たぶんそうです。いろいろなやってまった。Results:
1. Controllerの名前なし:

> script/generate scaffold user
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?

2. Controllerの名前いれて、databaseつくってない(それかconfig/database.ymlが違う):

> script/generate scaffold user Users
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/users
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
   identical    app/models/user.rb
   identical    test/unit/user_test.rb
   identical    test/fixtures/users.yml

Modelを自動でつくってるだけどcontrollerとviewがつくてない。

3. まずdatabaseを作って、config/database.ymlなおして、 controllerの名前も入れて:

> script/generate scaffold user Users
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/users
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
      create    app/models/user.rb
      create    test/unit/user_test.rb
      create    test/fixtures/users.yml
      create  app/views/users/_form.rhtml
      create  app/views/users/list.rhtml
      create  app/views/users/show.rhtml
      create  app/views/users/new.rhtml
      create  app/views/users/edit.rhtml
      create  app/controllers/users_controller.rb
      create  test/functional/users_controller_test.rb
      create  app/helpers/users_helper.rb
      create  app/views/layouts/users.rhtml
      create  public/stylesheets/scaffold.css

ぜんぶOK.

--
ML: rails@r...
使い方: http://QuickML.com/
Web Site: http://wiki.fdiary.net/rails/
ML Archives: http://www.fdiary.net/ml/rails/

[前][次][番号順一覧][スレッド一覧]

       492 2005-10-31 01:33 [adachi@t...         ] generate scaffold ができません          
       493 2005-10-31 02:05 ┣[don@n...            ]                                       
       499 2005-10-31 03:02 ┃┗[adachi@t...         ]                                     
       502 2005-10-31 03:19 ┃ ┗[don@n...            ]                                   
       503 2005-10-31 03:19 ┃  ┗[don@n...            ]                                 
       495 2005-10-31 02:42 ┗[stoyan@g...         ]                                       
       497 2005-10-31 02:49  ┗[adachi@t...         ]                                     
->     500 2005-10-31 03:05   ┗[stoyan@g...         ]                                   
       501 2005-10-31 03:12    ┗[drawn.boy@g...      ]                                 
       504 2005-10-31 03:23     ┣[adachi@t...         ]                               
       535 2005-10-31 23:01     ┗[kazuhiko@f...       ]