Hi! Sorry for the newbie question... I''m following the depot example in AgileWebDevelopmentWithRails. Stangelly, generating scaffolding using the command (page 53): ./script/generate scaffold Product Admin does not generate any .rhtml file, but just: exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ identical app/models/product.rb identical test/unit/product_test.rb identical test/fixtures/products.yml Any suggestions? Thanks, jb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/9c155c1f/attachment.html
Hi Jose,>From the listing you included below, I''d say Rails is telling you that views for the Admin controller already exist (i.e., line 3 shows ''exists app/views/admin"). I thought the scaffold command would just overwrite anything that was already there, but maybe that''s been changed.hth, Bill ----- Original Message ----- From: Jos? Bonnet To: rails@lists.rubyonrails.org Sent: Thursday, April 20, 2006 10:45 AM Subject: [Rails] generate scaffold not generating views Hi! Sorry for the newbie question... I''m following the depot example in AgileWebDevelopmentWithRails. Stangelly, generating scaffolding using the command (page 53): ./script/generate scaffold Product Admin does not generate any .rhtml file, but just: exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ identical app/models/product.rb identical test/unit/product_test.rb identical test/fixtures/products.yml Any suggestions? Thanks, jb ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/2dbb39a2/attachment.html
Well, Bill, that''s the problem: neverthless, that directory is empty... jb On Apr 20, 2006, at 5:11 PM, Bill Walton wrote:> Hi Jose, > > From the listing you included below, I''d say Rails is telling you > that views for the Admin controller already exist (i.e., line 3 > shows ''exists app/views/admin"). I thought the scaffold command > would just overwrite anything that was already there, but maybe > that''s been changed. > > hth, > Bill > ----- Original Message ----- > From: Jos? Bonnet > To: rails@lists.rubyonrails.org > Sent: Thursday, April 20, 2006 10:45 AM > Subject: [Rails] generate scaffold not generating views > > Hi! > Sorry for the newbie question... > > I''m following the depot example in AgileWebDevelopmentWithRails. > Stangelly, generating scaffolding using the command (page 53): > > > ./script/generate scaffold Product Admin > > does not generate any .rhtml file, but just: > > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > identical app/models/product.rb > identical test/unit/product_test.rb > identical test/fixtures/products.yml > > Any suggestions? > > Thanks, > jb > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/2d219889/attachment.html
Jos?, Are you sure that''s all the output when you try to generate the scaffold? It should also try to generate controllers, etc. You might check to see that you have the products table created in the database, because the generator will abort while still incomplete if you don''t have the table. Jeff On 4/20/06, Jos? Bonnet <jbonnet@ptinovacao.pt> wrote:> > Well, Bill, that''s the problem: neverthless, that directory is empty... > jb > > On Apr 20, 2006, at 5:11 PM, Bill Walton wrote: > > Hi Jose, > > From the listing you included below, I''d say Rails is telling you that > views for the Admin controller already exist (i.e., line 3 shows ''exists > app/views/admin"). I thought the scaffold command would just > overwrite anything that was already there, but maybe that''s been changed. > > hth, > Bill > > ----- Original Message ----- > *From:* Jos? Bonnet <jbonnet@ptinovacao.pt> > *To:* rails@lists.rubyonrails.org > *Sent:* Thursday, April 20, 2006 10:45 AM > *Subject:* [Rails] generate scaffold not generating views > > Hi! > Sorry for the newbie question... > > I''m following the depot example in AgileWebDevelopmentWithRails. > Stangelly, generating scaffolding using the command (page 53): > > > ./script/generate scaffold Product Admin > > does not generate any .rhtml file, but just: > > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > identical app/models/product.rb > identical test/unit/product_test.rb > identical test/fixtures/products.yml > > Any suggestions? > > Thanks, > jb > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/af2c0686/attachment-0001.html
Hi, Jeff! Yes, I''ve got the table: sqlite> .tables products sqlite> .schema CREATE TABLE products (id integer primary key, title text, description text, image_url text, price numerical); Yes, I''ve generated the model (product) and the controller (admin). jbonnet$ ls -lisap app/controllers/ app/models/ app/controllers/: total 24 2721789 0 drwxr-xr-x 5 jbonnet jbonnet 170 Apr 20 17:51 ./ 2721788 0 drwxr-xr-x 6 jbonnet jbonnet 204 Apr 20 14:46 ../ 2726461 8 -rw-r--r-- 1 jbonnet jbonnet 70 Apr 20 17:51 admin_controller.rb 2721825 8 -rw-r--r-- 1 jbonnet jbonnet 216 Apr 20 14:46 application.rb 2726411 8 -rw-r--r-- 1 jbonnet jbonnet 72 Apr 20 17:46 product_controller.rb app/models/: total 16 2721791 0 drwxr-xr-x 4 jbonnet jbonnet 136 Apr 20 18:01 ./ 2721788 0 drwxr-xr-x 6 jbonnet jbonnet 204 Apr 20 14:46 ../ 2726664 8 -rw-r--r-- 1 jbonnet jbonnet 35 Apr 20 18:01 mdl.rb 2724171 8 -rw-r--r-- 1 jbonnet jbonnet 455 Apr 20 16:22 product.rb Neverthless: jbonnet$ ./script/generate scaffold product admin exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ skip app/models/product.rb identical test/unit/product_test.rb identical test/fixtures/products.yml So, no views:-( jb On Apr 20, 2006, at 6:17 PM, Jeff Everett wrote:> Jos?, > > Are you sure that''s all the output when you try to generate the > scaffold? It should also try to generate controllers, etc. > > You might check to see that you have the products table created in > the database, because the generator will abort while still > incomplete if you don''t have the table. > > Jeff > > On 4/20/06, Jos? Bonnet <jbonnet@ptinovacao.pt> wrote: > Well, Bill, that''s the problem: neverthless, that directory is > empty... > jb > > On Apr 20, 2006, at 5:11 PM, Bill Walton wrote: > >> Hi Jose, >> >> >From the listing you included below, I''d say Rails is telling you >> that views for the Admin controller already exist (i.e., line 3 >> shows ''exists app/views/admin"). I thought the scaffold command >> would just overwrite anything that was already there, but maybe >> that''s been changed. >> >> hth, >> Bill >> ----- Original Message ----- >> From: Jos? Bonnet >> To: rails@lists.rubyonrails.org >> Sent: Thursday, April 20, 2006 10:45 AM >> Subject: [Rails] generate scaffold not generating views >> >> Hi! >> Sorry for the newbie question... >> >> I''m following the depot example in AgileWebDevelopmentWithRails. >> Stangelly, generating scaffolding using the command (page 53): >> >> >> ./script/generate scaffold Product Admin >> >> does not generate any .rhtml file, but just: >> >> exists app/controllers/ >> exists app/helpers/ >> exists app/views/admin >> exists test/functional/ >> dependency model >> exists app/models/ >> exists test/unit/ >> exists test/fixtures/ >> identical app/models/product.rb >> identical test/unit/product_test.rb >> identical test/fixtures/products.yml >> >> Any suggestions? >> >> Thanks, >> jb >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/f51945be/attachment.html
Just in case: try deleting the /admin folder. -- Posted via http://www.ruby-forum.com/.
> Yes, I''ve generated the model (product) and the controller (admin).I''m not sure what you mean by this, but if you mean that you''ve done: ./script/generate controller Admin When you generate a controller it creates an empty /view/<controller name> folder that won''t be overwritten by future generates. Whereas if you do: ./script/generate scaffold Product Admin It creates a controller, a model, and the /view/admin files. -- Posted via http://www.ruby-forum.com/.
Hi, Adam! Just did it: 1. removed .../views/admin 2. jbonnet$ ./script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ create app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb identical test/unit/product_test.rb identical test/fixtures/products.yml That is, files in ../views/admin don''t get generated. I''m using the following versions: jbonnet$ rails -v Rails 1.1.2 jbonnet$ ruby -v ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] thanks, jb On Apr 20, 2006, at 8:01 PM, Adam Bloom wrote:>> Yes, I''ve generated the model (product) and the controller (admin). > > I''m not sure what you mean by this, but if you mean that you''ve done: > > ./script/generate controller Admin > > When you generate a controller it creates an empty /view/<controller > name> folder that won''t be overwritten by future generates. Whereas if > you do: > > ./script/generate scaffold Product Admin > > It creates a controller, a model, and the /view/admin files. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Ok, I''ve found it! I''ve upgraded to ruby 1.8.4, deleted .../app/views, and rerun ./script/generate scaffold Product Admin Now I have all the files I need: jbonnet$ ./script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ create app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ skip app/models/product.rb identical test/unit/product_test.rb identical test/fixtures/products.yml create app/views/admin/_form.rhtml create app/views/admin/list.rhtml create app/views/admin/show.rhtml create app/views/admin/new.rhtml create app/views/admin/edit.rhtml create app/controllers/admin_controller.rb create app/helpers/admin_helper.rb create app/views/layouts/admin.rhtml Thanks a lot! jb On Apr 20, 2006, at 10:03 PM, Jos? Bonnet wrote:> Hi, Adam! > Just did it: > 1. removed .../views/admin > 2. jbonnet$ ./script/generate scaffold Product Admin > exists app/controllers/ > exists app/helpers/ > create app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > identical test/unit/product_test.rb > identical test/fixtures/products.yml > > That is, files in ../views/admin don''t get generated. > I''m using the following versions: > jbonnet$ rails -v > Rails 1.1.2 > jbonnet$ ruby -v > ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] > > thanks, > jb > On Apr 20, 2006, at 8:01 PM, Adam Bloom wrote: > >>> Yes, I''ve generated the model (product) and the controller (admin). >> >> I''m not sure what you mean by this, but if you mean that you''ve done: >> >> ./script/generate controller Admin >> >> When you generate a controller it creates an empty /view/<controller >> name> folder that won''t be overwritten by future generates. >> Whereas if >> you do: >> >> ./script/generate scaffold Product Admin >> >> It creates a controller, a model, and the /view/admin files. >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails