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 applications 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 Application root C:/Aptana Studio/company Environment development Database adapter mysql Database schema version 1 -- 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 -~----------~----~----~----~------~----~------~--~---
For your information Scaffold is been removed out of core rails in rails 2.0.. Scaffold is available as a plugin now.. U can get "Active scaffold" from "http://activescaffold.com/" and u can install it by navigating to the project path in command prompt and by typing "ruby script/plugin install http://activescaffold.googlecode.com/svn/tags/active_scaffold" -- 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 -~----------~----~----~----~------~----~------~--~---
If you are able to generate scaffold that means you have Sccaffold installed over your project....i am not sure but the issue might me when you have generated sccafolding the table might have different structure and after generation of scaffolding you might have altered the table structure.. have a look at the generated code to confirm it....or else try once more with the table structure alreadt defiened before generating scaffolding... On Feb 2, 9:19 am, Ratnavel Sundaramurthi <rails-mailing-l...@andreas- s.net> wrote:> For your information Scaffold is been removed out of core rails in rails > 2.0.. > > Scaffold is available as a plugin now.. > > U can get "Active scaffold" from "http://activescaffold.com/" > and u can install it by navigating to the project path in command prompt > and by typing > "ruby script/plugin installhttp://activescaffold.googlecode.com/svn/tags/active_scaffold" > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Scaffold is different in Rails 2.0. When you ran your ''script/generate scaffold employee'' code, it generated the files necessary but since you did not specify the data fields upfront, it did not add them to your code. Here is the way you would do it: ''script/generate scaffold employee first_name:string last_name:string title:string description:text birthday:date'' If you want to add the data fields afterwards, open up the index.rhtml or index.html.erb file inside the /app/views/employees/ folder and insde the form, add: <%= employee.name %><br /> <%= employee.otherfield %> I highly recommend that you save yourself a lot of confusion and wasted time by going to www.PeepCode.com and purchasing their Rails from Scratch Series. It will cost you $18 ($9 per each hour n half video x 2 videos) but it will give you a strong foundation to build from. After going through those two videos, go to www.RailsCasts.com and watch his videos. On Feb 1, 6:58 pm, Tuan Minh <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > Application root C:/Aptana Studio/company > Environment development > Database adapter mysql > Database schema version 1 > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks everybody. Especially thank Melvin Ram, I have done successfully. Scaffold is different in Rails 2.0. -- 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 -~----------~----~----~----~------~----~------~--~---