Skip to content

@Nitrodist /gist:728710
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
mcampbell42@ubuntu:~$ rails new testsite
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create log
create log/server.log
create log/production.log
create log/development.log
create log/test.log
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create public/images
create public/images/rails.png
create public/stylesheets
create public/stylesheets/.gitkeep
create public/javascripts
create public/javascripts/application.js
create public/javascripts/controls.js
create public/javascripts/dragdrop.js
create public/javascripts/effects.js
create public/javascripts/prototype.js
create public/javascripts/rails.js
create script
create script/rails
create test
create test/fixtures
create test/functional
create test/integration
create test/performance/browsing_test.rb
create test/test_helper.rb
create test/unit
create tmp
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create vendor/plugins
create vendor/plugins/.gitkeep
mcampbell42@ubuntu:~$ cd testsite/
mcampbell42@ubuntu:~/testsite$ rails generate scaffold product name:string upc:string
invoke active_record
create db/migrate/20101205024212_create_products.rb
create app/models/product.rb
invoke test_unit
create test/unit/product_test.rb
create test/fixtures/products.yml
route resources :products
invoke scaffold_controller
create app/controllers/products_controller.rb
invoke erb
create app/views/products
create app/views/products/index.html.erb
create app/views/products/edit.html.erb
create app/views/products/show.html.erb
create app/views/products/new.html.erb
create app/views/products/_form.html.erb
invoke test_unit
create test/functional/products_controller_test.rb
invoke helper
create app/helpers/products_helper.rb
invoke test_unit
create test/unit/helpers/products_helper_test.rb
invoke stylesheets
create public/stylesheets/scaffold.css
mcampbell42@ubuntu:~/testsite$ vim app/
controllers/ helpers/ mailers/ models/ views/
mcampbell42@ubuntu:~/testsite$ vim app/models/product.rb
class Product < ActiveRecord::Base
def upc=(val)
self.upc = val.strip
end
end
mcampbell42@ubuntu:~/testsite$ rake db:migrate
(in /home/mcampbell42/testsite)
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0033s
== CreateProducts: migrated (0.0034s) ========================================
mcampbell42@ubuntu:~/testsite$ rails c
Loading development environment (Rails 3.0.3)
ruby-1.9.2-p0 > p = Product.new
=> #<Product id: nil, name: nil, upc: nil, created_at: nil, updated_at: nil>
ruby-1.9.2-p0 > p.upc = '123-456-789-X '
SystemStackError: stack level too deep
from /home/mcampbell42/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/workspace.rb:80
Maybe IRB bug!!
ruby-1.9.2-p0 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.