pravin mishra
2010-Jun-24 18:44 UTC
scaffold not generating _form.rhtlml.erb fiel in app/view
i have installed ruby 1.8.6 window version, rails 2.0.2 everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot>ruby script/generate scaffold Album albums it gives following error "WRONG NUMBER OF ARGUMENTS (1 FOR 2)" i tried with many dummyprojects and tutorial, BUT if i run ruby script/generate scaffold modelname e.g ruby script/generate scaffold Album IT''S RUN FINE SEE THE FOLLOWING C:\InstantRails-2.0-win_2\rails_apps\music_library_development>ruby script/generate scaffold Album albums 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) C:\InstantRails-2.0-win_2\rails_apps\music_library_development>ruby script/generate scaffold Album exists app/models/ exists app/controllers/ exists app/helpers/ exists app/views/albums exists app/views/layouts/ exists test/functional/ exists test/unit/ create app/views/products/index.html.erb create app/views/products/show.html.erb create app/views/products/new.html.erb create app/views/products/edit.html.erb create app/views/layouts/albums.html.erb create public/stylesheets/scaffold.css dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/album.rb create test/unit/album_test.rb create test/fixtures/albums.yml create db/migrate create db/migrate/20080628070012_create_albums.rb create app/controllers/albums_controller.rb create test/functional/albums_controller_test.rb create app/helpers/albums_helper.rb route map.resources :albums C:\InstantRails-2.0-win_2\rails_apps\music_library_development> BUT RESULTS ARE A BIT DIFFERENT , i am looking for Modelname "album", Controllername " albums " and Actions "show.rhtml, new.rhml, edit.rhtml,_form.rhtml" BUT RESULTS ARE Modelname " album" , Controllername " albums",and Actions "show.html.erb,new.html.erb,edit.html.erb,index.html.erb" PLZ HELP ME WHAT''S GOING WRONG Thanks Pravin Mishra Pravinmishra88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
pravin mishra
2010-Jun-24 19:09 UTC
scaffold not generating _form.rhtlml.erb fiel in app/view
I''m learning about Ruby on Rails. Please help me. Althougth I do step-by-step with books(config data, generate model, add data field in db/migrate/file.rb) but i can''t generate with scaffold or error. When run command: ruby script\generate scaffold Employee And check: http://127.0.0.1:3000/employees/ --> it shows successful with show,edit,destroy however it can''t show data field although i inserted data in mysql. It shows: --------------------------------------------- Listing employees Show Edit Destroy Show Edit Destroy New employee ---------------------------------------- Or if i click on: New employee, it doesn''t have textbox to input data. It shows: --------------------------------- New employee Back ---------------------------------- About your application’s environment: Ruby version 1.8.6 (i386-mswin32) RubyGems version 0.9.4 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2 Active Resource version 2.0.2 Action Mailer version 2.0.2 Active Support version 2.0.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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
You need a model name then the attributes for the model. ruby script/generate scaffold modelname name:string, etc .... On Jun 24, 1:44 pm, pravin mishra <pravinmishr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i have installed > ruby 1.8.6 window version, > rails 2.0.2 > > everything runs fine except SCAFFOLD > when i run > ruby script/generate scaffold modelname controllername actions > e,g. C:depot>ruby script/generate scaffold Album albums > it gives following error > "WRONG NUMBER OF ARGUMENTS (1 FOR 2)" > i tried with many dummyprojects and tutorial, > BUT if i run > ruby script/generate scaffold modelname > e.g ruby script/generate scaffold Album > IT''S RUN FINE > SEE THE FOLLOWING > > C:\InstantRails-2.0-win_2\rails_apps\music_library_development>ruby > script/generate scaffold Album albums > 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) > > C:\InstantRails-2.0-win_2\rails_apps\music_library_development>ruby > script/generate scaffold Album > exists app/models/ > exists app/controllers/ > exists app/helpers/ > exists app/views/albums > exists app/views/layouts/ > exists test/functional/ > exists test/unit/ > create app/views/products/index.html.erb > create app/views/products/show.html.erb > create app/views/products/new.html.erb > create app/views/products/edit.html.erb > create app/views/layouts/albums.html.erb > create public/stylesheets/scaffold.css > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/album.rb > create test/unit/album_test.rb > create test/fixtures/albums.yml > create db/migrate > create db/migrate/20080628070012_create_albums.rb > create app/controllers/albums_controller.rb > create test/functional/albums_controller_test.rb > create app/helpers/albums_helper.rb > route map.resources :albums > > C:\InstantRails-2.0-win_2\rails_apps\music_library_development> > > BUT RESULTS ARE A BIT DIFFERENT , > i am looking for Modelname "album", Controllername " albums " > and Actions "show.rhtml, new.rhml, edit.rhtml,_form.rhtml" > > BUT RESULTS ARE > Modelname " album" , Controllername " albums",and Actions > "show.html.erb,new.html.erb,edit.html.erb,index.html.erb" > > PLZ HELP ME WHAT''S GOING WRONG > Thanks > > Pravin Mishra > Pravinmishr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.