In mysql:
createdb TEST;
create table TEST.test (id int key auto_increment, title varchar(10) not null);
Then execute:
rails test
cd test
Now update config/database.yml
Execute:
ruby script/generate model test
ruby script/generate controller test
edit app/controllers/test_controller.rb:
class TestController <>
scaffold :test
end
Edit config/environment.rb:
ActiveRecord::Base.pluralize_table_names = false
Browse to:
http://localhost:3000/test/list
No comments:
Post a Comment