With one command line I’ve created the weight model and the scaffolding, a fully functional CRUD little app without my Rails app. I know all Rails developer are rolling eyes now; but I still think this is awesome. It gets you up and running so fast:
./script/generate scaffold weight user_id:integer weight:float timestamp:datetime
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/weights
create app/views/layouts/
create test/functional/
exists test/unit/
create test/unit/helpers/
create public/stylesheets/
create app/views/weights/index.html.erb
create app/views/weights/show.html.erb
create app/views/weights/new.html.erb
create app/views/weights/edit.html.erb
create app/views/layouts/weights.html.erb
create public/stylesheets/scaffold.css
create app/controllers/weights_controller.rb
create test/functional/weights_controller_test.rb
create app/helpers/weights_helper.rb
create test/unit/helpers/weights_helper_test.rb
route map.resources :weights
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/weight.rb
create test/unit/weight_test.rb
create test/fixtures/weights.yml
exists db/migrate
create db/migrate/20091121135320_create_weights.rb
And this is what I’ve got:






Related posts: