Hey guys, i have just set up a database and ruby on rails application. I then did a ruby script\generate Product Admin which should give it all of the nessasary parts to run as a web app. Instead it did this: C:\ruby\depot>ruby script\generate scaffold Product exists app/models/ exists app/controllers/ exists app/helpers/ create app/views/products exists app/views/layouts/ exists test/functional/ exists test/unit/ create app/views/products/index.html.erb wrong number of arguments (1 for 2) How can i fix this? Thanks Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you using Rails 2.0? If so, provide your scaffold with your model''s definition, liike this: ruby script\generate scaffold Product code:integer name:string Make sure your you destroy your model first. I posted something related to this here: http://leonardoborges.com/writings/2007/12/21/rails-20-scaffold/ Hope it helps On Dec 21, 1:56 pm, Chris Willis <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hey guys, > i have just set up a database and ruby on rails application. I then did > a ruby script\generate Product Admin which should give it all of the > nessasary parts to run as a web app. Instead it did this: > > C:\ruby\depot>ruby script\generate scaffold Product > exists app/models/ > exists app/controllers/ > exists app/helpers/ > create app/views/products > exists app/views/layouts/ > exists test/functional/ > exists test/unit/ > create app/views/products/index.html.erb > wrong number of arguments (1 for 2) > > How can i fix this? > Thanks > Chris > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
My assumption is that the original poster is trying to follow the Agile Web Development with Rails book which is not compatible with Rails 2.0 My suggestion is to uninstall Rails gem uninstall rails then reinstall the specific version that will work with that book gem install version=1.2.6 rails Then, recreate the depot application rails depot That will allow you to complete the book, afterwhich you can upgrade to Rails 2.0. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ack... mistake in my commands. To install Rails 1.2.6, you should do gem install --version=1.2.6 rails - I forgot the two -- On Dec 21, 2007 3:52 PM, Brian Hogan <bphogan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> My assumption is that the original poster is trying to follow the Agile > Web Development with Rails book which is not compatible with Rails 2.0 > > My suggestion is to uninstall Rails > > gem uninstall rails > > then reinstall the specific version that will work with that book > > gem install version=1.2.6 rails > > Then, recreate the depot application > > rails depot > > That will allow you to complete the book, afterwhich you can upgrade to > Rails 2.0. >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 21, 2007, at 10:56 AM, Chris Willis wrote:> C:\ruby\depot>ruby script\generate scaffold ProductYou''re leaving out the controller name. If you''re following the book It should be ruby script/generate scaffold product admin --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks You guessed it! I will do that Thanks Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I am also having the same problem. command: ruby script/generate scaffold product admin the above command creates controller as well as default view. command: ruby script\generate scaffold Product code:integer name:string In the above command, I don''t specify controller, so how will the controller and views will be created? Thanks. Vinod -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The new scaffolds are RESTful, so they derive their controller name from the model name (e.g., Product -> ProductsController). Look up information on REST and RESTful Rails for more explanation. --Jeremy On Jan 1, 2008 11:24 PM, Vinod Jain <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > > I am also having the same problem. > > command: ruby script/generate scaffold product admin > the above command creates controller as well as default view. > > > command: ruby script\generate scaffold Product code:integer name:string > In the above command, I don''t specify controller, so how will the > controller and views will be created? > > Thanks. > > Vinod > > > > -- > Posted via http://www.ruby-forum.com/. > > > >-- http://www.jeremymcanally.com/ My books: Ruby in Practice http://www.manning.com/mcanally/ My free Ruby e-book http://www.humblelittlerubybook.com/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brian Hogan wrote:> My assumption is that the original poster is trying to follow the Agile > Web > Development with Rails book which is not compatible with Rails 2.0 > > My suggestion is to uninstall Rails > > gem uninstall rails > > then reinstall the specific version that will work with that book > > gem install version=1.2.6 rails > > Then, recreate the depot application > > rails depot > > That will allow you to complete the book, afterwhich you can upgrade to > Rails 2.0.I trying to follow the AWDWR 2nd Edition book and I''ve seen your suggestion in other place too. I can''t see the point though, what is the point on learning an obsolete version of rails when the new one is obviously so different! Does anybody know how to work around this problem with Rails 2.x? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Leonardo wrote:> Are you using Rails 2.0? > > If so, provide your scaffold with your model''s definition, liike this: > ruby script\generate scaffold Product code:integer name:string > > Make sure your you destroy your model first. > > I posted something related to this here: > http://leonardoborges.com/writings/2007/12/21/rails-20-scaffold/ > > Hope it helps > > On Dec 21, 1:56�pm, Chris Willis <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>You don''t need to destroy the model! The command: ruby script\generate scaffold Product will create a controller called Products. I''m just using that controller instead of the admin one. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The new version of Rails isn''t actually so different from what I can see - although i''m still learning also, so I''m open to correction there... what the scaffold does now is to generate the view, controller, and model all in one... it also generates a database migration file (in the db folder) which can be edited before performing a rake db:migrate to create the database table with relevant fields... it''s not really too complex...>what is the > point on learning an obsolete version of rails when the new one is > obviously so different!--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---