Laim, Scaffold will do it all (in a cookie cutter way), if given the right arguments.
script/generate scaffold User name:string profile:text NOTE:--------------------------------^ ----------------^ This single command will create a controller, model, views, and db/ migration for the User model with fields for name and profile. rake db:migrate script/server point your browser at: http://localhost:3000/users and follow the link to "New user". look at the files: app/controllers/users_controller.rb app/views/users/... app/models/user.rb db/migrate/...create_users.rb On Jul 25, 2:34 pm, Laim Bee <[email protected]> wrote: > Hey everyone, > > I am new to ROR. I have been reading "Begininng Ruby on Rails" by Steven > Holznewr and "Ruby on Rails for Dummies" by Barry Burd. I have been > going through this a lot slower than I would like, because many of the > examples don't work and I've been trying to glean information from both > books to get them working. My current problem is this: > > Following Chapter 9 in "Ruby on Rails for Dummies" we are trying to > build a website for Photos. This website will interface with a mysql > database. I have built out the database, created a model, created a > database table, wrote some code in the migration code to create a column > for filename and description, and created a scaffold. > > When I launch the server and view my website for extension photos/new > (creating a new photo in the database), I just see a button titled > "Create". The book shows a screenshot of two text fields being created, > one for filename and one for description. I'm assuming that I have to > add code to the scaffold to show these forms, is this true? Otherwise > I'm just adding blank entries. > > I am currently using > Rad Rails 1.5.0.025739 > Ruby 1.8.6 > and I believe Rails 2.2 > > Any suggestions on what I'm missing? > -- > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

