View
143
Download
0
Category
Preview:
Citation preview
Slideshare http://www.slideshare.net/yasulab/presentations
1. Web − Home/About/Help/Signup − Bootstrap − Partial
2. Asset Pipeline Sass
3. (Integration Test) $ rails generate integration_test site_layout
4. $ rails generate controller Users new
• User rails generate model User name:string email:string
• db/migrate/[timestamp]_create_users.rb
• (bundle exec rake db:migrate)
• (bundle exec rake db:rollback)
• db/development.sqlite3
• rails console
User
(Unique)
1.
sample_app
tom@example.com
2. ?
DB
tom@example.com
sample_app
3. ?
4. email 5. email
6.
(Unique)
1.
sample_app
tom@example.com
2. ?
DB
tom@example.com
sample_app
3. ?
4. email 6. email
5.
!
7. email
><
DB
bcrypt
foobarhogehoge
$10$2FIEggLq.BFq7J17N7a9C.mTBgKeJ9uWanLq…
$2a$10$Kc/EY79ieCTBVYFktWkUKOhhY0kItaYPAyMsT23rvAR…
password_digest
• Test→Commit→Merge→Push 💨
…
⚠ Heroku push !
🔧 DB
• Heroku migrate console 💻 ☁$ heroku run rails db:migrate $ heroku run console --sandbox
Active Record http://railsguides.jp/active_record_basics.html
Active Record http://railsguides.jp/active_record_migrations.html
Active Record http://railsguides.jp/active_record_validations.html
1. Micropost (cf. 2, 4, 6 ) User Micropost − User has_many Microposts − Micropost belongs_to User
2. Micropost (cf. 7~8 )
3. Micropost (cf. 9 )
4. Micropost
1. Relationship
• User
• Relationship followed/follower
• follow
2. Ajax follow/unfollow UI
3. follow feed
4. / /
Recommended