Hello I have a problem with the example from the rails book I type ruby script/generate scaffold Product Admin and the product modell is createed but $ ls app/controllers/ application.rb products_controller.rb as you can see there is no admin controller. this is probably why I get a routing error. when I type ruby script/generate controller Admin the controller is generated but when going to http://localhost:3000/admin I get this: Unknown action No action responded to index this URL works: http://localhost:3000/products and I get the same as in the book with the admin URL. the database is setup correctly. any idea what I am doing wrong here ? regards Markus ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
On 10/13/05, Markus Jais <markus_jais-LWAfsSFWpa4@public.gmane.org> wrote:> Hello > > I have a problem with the example from the rails book > > I type > > ruby script/generate scaffold Product Admin > > and the product modell is createed but > > $ ls app/controllers/ > application.rb products_controller.rb > > as you can see there is > no admin controller. this is probably why I get a > routing error. > when I type > ruby script/generate controller Admin > > the controller is generated but when going to > http://localhost:3000/admin > I get this: > > Unknown action > No action responded to index > > this URL works: > http://localhost:3000/products > > and I get the same as in the book with the admin URL. > > the database is setup correctly. > > any idea what I am doing wrong here ?You need to put an index action in the admin controller.
--- Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> schrieb:> On 10/13/05, Markus Jais <markus_jais-LWAfsSFWpa4@public.gmane.org> > wrote: > > Hello > > > > I have a problem with the example from the rails > book > > > > I type > > > > ruby script/generate scaffold Product Admin > > > > and the product modell is createed but > > > > $ ls app/controllers/ > > application.rb products_controller.rb > > > > as you can see there is > > no admin controller. this is probably why I get a > > routing error. > > when I type > > ruby script/generate controller Admin > > > > the controller is generated but when going to > > http://localhost:3000/admin > > I get this: > > > > Unknown action > > No action responded to index > > > > this URL works: > > http://localhost:3000/products > > > > and I get the same as in the book with the admin > URL. > > > > the database is setup correctly. > > > > any idea what I am doing wrong here ? > > You need to put an index action in the admin > controller.hi thanks. but shouldn''t this all be generated by the scaffold command ? in app/controllers/products_controller.rb there is a lot of code which does what according to the book the admin controller should do. I think not everything is generated: here the output of the command according to the book: ruby script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ create app/views/products exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb create test/unit/product_test.rb create test/fixtures/products.yml create app/views/products/_form.rhtml create app/views/products/list.rhtml create app/views/products/show.rhtml create app/views/products/new.rhtml create app/views/products/edit.rhtml create app/controllers/products_controller.rb create test/functional/products_controller_test.rb create app/helpers/products_helper.rb create app/views/layouts/products.rhtml create public/stylesheets/scaffold.css there is no admin stuff generated. I have ruby 1.8.3 and beta rails rails-0.13.1.2471. any ideas what''s wrong here ? regards Markus ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
On 10/13/05, Markus Jais <markus_jais-LWAfsSFWpa4@public.gmane.org> wrote:> > --- Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> schrieb: > > > On 10/13/05, Markus Jais <markus_jais-LWAfsSFWpa4@public.gmane.org> > > wrote: > > > Hello > > > > > > I have a problem with the example from the rails > > book > > > > > > I type > > > > > > ruby script/generate scaffold Product Admin > > > > > > and the product modell is createed but > > > > > > $ ls app/controllers/ > > > application.rb products_controller.rb > > > > > > as you can see there is > > > no admin controller. this is probably why I get a > > > routing error. > > > when I type > > > ruby script/generate controller Admin > > > > > > the controller is generated but when going to > > > http://localhost:3000/admin > > > I get this: > > > > > > Unknown action > > > No action responded to index > > > > > > this URL works: > > > http://localhost:3000/products > > > > > > and I get the same as in the book with the admin > > URL. > > > > > > the database is setup correctly. > > > > > > any idea what I am doing wrong here ? > > > > You need to put an index action in the admin > > controller. > > hi > > thanks. but shouldn''t this all be generated > by the scaffold command ? > in > app/controllers/products_controller.rb > > there is a lot of code which does what according to > the book the admin controller should do. > > > I think not everything is generated: > here the output of the command according to the book: > > > ruby script/generate scaffold Product Admin > exists app/controllers/ > exists app/helpers/ > create app/views/products > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > create test/unit/product_test.rb > create test/fixtures/products.yml > create app/views/products/_form.rhtml > create app/views/products/list.rhtml > create app/views/products/show.rhtml > create app/views/products/new.rhtml > create app/views/products/edit.rhtml > create app/controllers/products_controller.rb > create > test/functional/products_controller_test.rb > create app/helpers/products_helper.rb > create app/views/layouts/products.rhtml > create public/stylesheets/scaffold.css > > > > there is no admin stuff generated. > > I have ruby 1.8.3 and beta rails rails-0.13.1.2471. > > any ideas what''s wrong here ?Try Ruby 1.8.2 and the stable Rails.