InstantRails how to

2,115 views

Published on

2007/08/11 ワイズノット社内勉強会

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,115
On SlideShare
0
From Embeds
0
Number of Embeds
37
Actions
Shares
0
Downloads
84
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

InstantRails how to

  1. 1. 127.0.0.1       localhost 127.0.0.1       mybookshelf
  2. 2. C:¥InstantRails¥rails_apps>rails mybookshelf create create  app/controllers create  app/helpers . . . create  log/production.log create  log/development.log create  log/test.log C:¥InstantRails¥rails_apps>
  3. 3. mybookshelf_development
  4. 4. mybookshelfpass
  5. 5. ¥ ¥ ¥ ¥ ¥ # And be sure to use new‐style password hashing: #   http://dev.mysql.com/doc/refman/5.0/en/old‐client.html development: adapter: mysql database: mybookshelf_development username: mybookshelf password: mybookshelfpass host: localhost encode: utf8 # Warning: The database defined as 'test' will be erased and
  6. 6. C:¥InstantRails¥rails_apps¥mybookshelf>ruby script¥generate model Book isbn:string title:string review:text exists  app/models/ exists  test/unit/ exists  test/fixtures/ create  app/models/book.rb create  test/unit/book_test.rb create  test/fixtures/books.yml create  db/migrate create  db/migrate/001_create_books.rb C:¥InstantRails¥rails_apps¥mybookshelf>
  7. 7. C:¥InstantRails¥rails_apps¥mybookshelf>rake db:migrate (in C:/InstantRails/rails_apps/mybookshelf) == CreateBooks: migrating ================================= ‐‐ create_table(:books) ‐> 0.0400s == CreateBooks: migrated (0.0400s) ======================== C:¥InstantRails¥rails_apps¥mybookshelf>
  8. 8. C:¥InstantRails¥rails_apps¥mybookshelf>ruby script¥generate scaffold Book exists  app/controllers/ exists  app/helpers/ create  app/views/books . . . create  app/helpers/books_helper.rb create  app/views/layouts/books.rhtml create  public/stylesheets/scaffold.css C:¥InstantRails¥rails_apps¥mybookshelf>

×