چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

The Ruby on Rails Tutorial

Michael Hartl

قیمت نهایی

۴۹٬۰۰۰ تومان

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

نویسنده
Michael Hartl
سال انتشار
۲۰۲۰
فرمت
PDF
زبان
انگلیسی
حجم فایل
۳۳٫۲ مگابایت

دربارهٔ کتاب

From zero to deploy......Page 23 Up and running......Page 29 Development environment......Page 30 Installing Rails......Page 38 The first application......Page 39 Bundler......Page 42 rails server......Page 49 Model-View-Controller (MVC)......Page 56 Hello, world!......Page 57 Version control with Git......Page 61 Installation and setup......Page 64 What good does Git do you?......Page 68 GitHub......Page 69 Branch, edit, commit, merge......Page 74 Heroku setup and deployment......Page 82 Heroku commands......Page 88 What we learned in this chapter......Page 89 Conventions used in this book......Page 90 A toy app......Page 93 Planning the application......Page 94 A toy model for users......Page 98 A toy model for microposts......Page 99 The Users resource......Page 100 A user tour......Page 103 MVC in action......Page 111 The Microposts resource......Page 119 A micropost microtour......Page 120 Putting the micro in microposts......Page 126 A user has_many microposts......Page 128 Inheritance hierarchies......Page 131 Deploying the toy app......Page 137 Conclusion......Page 139 What we learned in this chapter......Page 142 Mostly static pages......Page 143 Sample app setup......Page 144 Static pages......Page 151 Generated static pages......Page 153 Custom static pages......Page 162 Getting started with testing......Page 163 Our first test......Page 168 Red......Page 170 Green......Page 171 Refactor......Page 174 Slightly dynamic pages......Page 176 Testing titles (Red)......Page 177 Adding page titles (Green)......Page 178 Layouts and embedded Ruby (Refactor)......Page 183 Setting the root route......Page 190 Conclusion......Page 193 Advanced testing setup......Page 195 Automated tests with Guard......Page 196 Motivation......Page 201 Built-in helpers......Page 202 Custom helpers......Page 203 Strings and methods......Page 207 Strings......Page 209 Objects and message passing......Page 213 Method definitions......Page 217 Back to the title helper......Page 219 Arrays and ranges......Page 220 Blocks......Page 225 Hashes and symbols......Page 229 CSS revisited......Page 234 Ruby classes......Page 236 Constructors......Page 237 Class inheritance......Page 238 Modifying built-in classes......Page 243 A controller class......Page 245 A user class......Page 248 Conclusion......Page 251 What we learned in this chapter......Page 252 Filling in the layout......Page 253 Adding some structure......Page 254 Site navigation......Page 256 Bootstrap and custom CSS......Page 266 Partials......Page 275 Sass and the asset pipeline......Page 281 The asset pipeline......Page 282 Syntactically awesome stylesheets......Page 285 Layout links......Page 292 Contact page......Page 293 Rails routes......Page 295 Using named routes......Page 299 Layout link tests......Page 300 Users controller......Page 306 Signup URL......Page 308 Conclusion......Page 311 What we learned in this chapter......Page 313 Modeling users......Page 315 User model......Page 316 Database migrations......Page 318 The model file......Page 325 Creating user objects......Page 326 Finding user objects......Page 330 Updating user objects......Page 332 User validations......Page 334 A validity test......Page 335 Validating presence......Page 338 Length validation......Page 342 Format validation......Page 344 Uniqueness validation......Page 351 A hashed password......Page 361 User has secure password......Page 364 Minimum password standards......Page 366 Creating and authenticating a user......Page 369 Conclusion......Page 372 What we learned in this chapter......Page 373 Sign up......Page 375 Debug and Rails environments......Page 376 A Users resource......Page 384 Debugger......Page 390 A Gravatar image and a sidebar......Page 394 Signup form......Page 402 Using form_with......Page 404 Signup form HTML......Page 407 A working form......Page 412 Strong parameters......Page 417 Signup error messages......Page 420 A test for invalid submission......Page 426 Successful signups......Page 429 The finished signup form......Page 431 The flash......Page 433 The first signup......Page 437 A test for valid submission......Page 441 SSL in production......Page 444 Production webserver......Page 446 Production database configuration......Page 447 Production deployment......Page 448 What we learned in this chapter......Page 451 Basic login......Page 453 Sessions......Page 454 Sessions controller......Page 455 Login form......Page 458 Finding and authenticating a user......Page 463 Rendering with a flash message......Page 468 A flash test......Page 471 Logging in......Page 473 The log_in method......Page 474 Current user......Page 477 Changing the layout links......Page 482 Testing layout changes......Page 499 Login upon signup......Page 506 Logging out......Page 509 Conclusion......Page 512 What we learned in this chapter......Page 513 Remember me......Page 515 Remember token and digest......Page 516 Login with remembering......Page 523 Forgetting users......Page 533 Two subtle bugs......Page 536 ``Remember me'' checkbox......Page 541 Remember tests......Page 548 Testing the ``remember me'' box......Page 549 Testing the remember branch......Page 555 What we learned in this chapter......Page 559 Updating users......Page 563 Edit form......Page 564 Unsuccessful edits......Page 572 Testing unsuccessful edits......Page 575 Successful edits (with TDD)......Page 576 Authorization......Page 580 Requiring logged-in users......Page 582 Requiring the right user......Page 588 Friendly forwarding......Page 594 Users index......Page 599 Sample users......Page 606 Pagination......Page 609 Users index test......Page 614 Partial refactoring......Page 616 Deleting users......Page 618 Administrative users......Page 619 The destroy action......Page 624 User destroy tests......Page 627 Conclusion......Page 631 What we learned in this chapter......Page 633 Account activation......Page 635 Account activations controller......Page 637 Account activation data model......Page 639 Mailer templates......Page 646 Email previews......Page 652 Email tests......Page 654 Updating the Users create action......Page 659 Generalizing the authenticated? method......Page 664 Activation edit action......Page 670 Activation test and refactoring......Page 673 Email in production......Page 681 What we learned in this chapter......Page 685 Password reset......Page 687 Password resets resource......Page 691 Password resets controller......Page 692 New password resets......Page 695 Password reset create action......Page 698 Password reset mailer and templates......Page 703 Email tests......Page 710 Resetting the password......Page 711 Reset edit action......Page 712 Updating the reset......Page 716 Password reset test......Page 722 Email in production (take two)......Page 728 Conclusion......Page 730 Proof of expiration comparison......Page 732 A Micropost model......Page 735 The basic model......Page 736 Micropost validations......Page 739 User/Micropost associations......Page 742 Micropost refinements......Page 747 Rendering microposts......Page 753 Sample microposts......Page 759 Profile micropost tests......Page 766 Manipulating microposts......Page 769 Micropost access control......Page 770 Creating microposts......Page 774 A proto-feed......Page 784 Destroying microposts......Page 795 Micropost tests......Page 802 Basic image upload......Page 806 Image validation......Page 814 Image resizing......Page 821 Image upload in production......Page 826 Conclusion......Page 834 What we learned in this chapter......Page 837 Following users......Page 839 A problem with the data model (and a solution)......Page 840 User/relationship associations......Page 850 Relationship validations......Page 853 Followed users......Page 855 Followers......Page 859 Sample following data......Page 862 Stats and a follow form......Page 864 Following and followers pages......Page 876 A working follow button the standard way......Page 887 A working follow button with Ajax......Page 892 Following tests......Page 897 The status feed......Page 899 Motivation and strategy......Page 901 A first feed implementation......Page 903 Subselects......Page 907 Guide to further resources......Page 913 What we learned in this chapter......Page 915 From zero to deploy 23 Up and running 29 Development environment 30 Installing Rails 38 The first application 39 Bundler 42 rails server 49 Model-View-Controller (MVC) 56 Hello, world! 57 Version control with Git 61 Installation and setup 64 What good does Git do you? 68 GitHub 69 Branch, edit, commit, merge 74 Deploying 82 Heroku setup and deployment 82 Heroku commands 88 Conclusion 89 What we learned in this chapter 89 Conventions used in this book 90 A toy app 93 Planning the application 94 A toy model for users 98 A toy model for microposts 99 The Users resource 100 A user tour 103 MVC in action 111 Weaknesses of this Users resource 119 The Microposts resource 119 A micropost microtour 120 Putting the micro in microposts 126 A user has_many microposts 128 Inheritance hierarchies 131 Deploying the toy app 137 Conclusion 139 What we learned in this chapter 142 Mostly static pages 143 Sample app setup 144 Static pages 151 Generated static pages 153 Custom static pages 162 Getting started with testing 163 Our first test 168 Red 170 Green 171 Refactor 174 Slightly dynamic pages 176 Testing titles (Red) 177 Adding page titles (Green) 178 Layouts and embedded Ruby (Refactor) 183 Setting the root route 190 Conclusion 193 What we learned in this chapter 195 Advanced testing setup 195 minitest reporters 196 Automated tests with Guard 196 Rails-flavored Ruby 201 Motivation 201 Built-in helpers 202 Custom helpers 203 Strings and methods 207 Strings 209 Objects and message passing 213 Method definitions 217 Back to the title helper 219 Other data structures 220 Arrays and ranges 220 Blocks 225 Hashes and symbols 229 CSS revisited 234 Ruby classes 236 Constructors 237 Class inheritance 238 Modifying built-in classes 243 A controller class 245 A user class 248 Conclusion 251 What we learned in this chapter 252 Filling in the layout 253 Adding some structure 254 Site navigation 256 Bootstrap and custom CSS 266 Partials 275 Sass and the asset pipeline 281 The asset pipeline 282 Syntactically awesome stylesheets 285 Layout links 292 Contact page 293 Rails routes 295 Using named routes 299 Layout link tests 300 User signup: A first step 306 Users controller 306 Signup URL 308 Conclusion 311 What we learned in this chapter 313 Modeling users 315 User model 316 Database migrations 318 The model file 325 Creating user objects 326 Finding user objects 330 Updating user objects 332 User validations 334 A validity test 335 Validating presence 338 Length validation 342 Format validation 344 Uniqueness validation 351 Adding a secure password 361 A hashed password 361 User has secure password 364 Minimum password standards 366 Creating and authenticating a user 369 Conclusion 372 What we learned in this chapter 373 Sign up 375 Showing users 376 Debug and Rails environments 376 A Users resource 384 Debugger 390 A Gravatar image and a sidebar 394 Signup form 402 Using form_with 404 Signup form HTML 407 Unsuccessful signups 412 A working form 412 Strong parameters 417 Signup error messages 420 A test for invalid submission 426 Successful signups 429 The finished signup form 431 The flash 433 The first signup 437 A test for valid submission 441 Professional-grade deployment 444 SSL in production 444 Production webserver 446 Production database configuration 447 Production deployment 448 Conclusion 451 What we learned in this chapter 451 Basic login 453 Sessions 454 Sessions controller 455 Login form 458 Finding and authenticating a user 463 Rendering with a flash message 468 A flash test 471 Logging in 473 The log_in method 474 Current user 477 Changing the layout links 482 Testing layout changes 499 Login upon signup 506 Logging out 509 Conclusion 512 What we learned in this chapter 513 Advanced login 515 Remember me 515 Remember token and digest 516 Login with remembering 523 Forgetting users 533 Two subtle bugs 536 ``Remember me'' checkbox 541 Remember tests 548 Testing the ``remember me'' box 549 Testing the remember branch 555 Conclusion 559 What we learned in this chapter 559 Updating, showing, and deleting users 563 Updating users 563 Edit form 564 Unsuccessful edits 572 Testing unsuccessful edits 575 Successful edits (with TDD) 576 Authorization 580 Requiring logged-in users 582 Requiring the right user 588 Friendly forwarding 594 Showing all users 599 Users index 599 Sample users 606 Pagination 609 Users index test 614 Partial refactoring 616 Deleting users 618 Administrative users 619 The destroy action 624 User destroy tests 627 Conclusion 631 What we learned in this chapter 633 Account activation 635 Account activations resource 637 Account activations controller 637 Account activation data model 639 Account activation emails 646 Mailer templates 646 Email previews 652 Email tests 654 Updating the Users create action 659 Activating the account 664 Generalizing the authenticated? method 664 Activation edit action 670 Activation test and refactoring 673 Email in production 681 Conclusion 685 What we learned in this chapter 685 Password reset 687 Password resets resource 691 Password resets controller 692 New password resets 695 Password reset create action 698 Password reset emails 703 Password reset mailer and templates 703 Email tests 710 Resetting the password 711 Reset edit action 712 Updating the reset 716 Password reset test 722 Email in production (take two) 728 Conclusion 730 What we learned in this chapter 732 Proof of expiration comparison 732 User microposts 735 A Micropost model 735 The basic model 736 Micropost validations 739 User/Micropost associations 742 Micropost refinements 747 Showing microposts 753 Rendering microposts 753 Sample microposts 759 Profile micropost tests 766 Manipulating microposts 769 Micropost access control 770 Creating microposts 774 A proto-feed 784 Destroying microposts 795 Micropost tests 802 Micropost images 806 Basic image upload 806 Image validation 814 Image resizing 821 Image upload in production 826 Conclusion 834 What we learned in this chapter 837 Following users 839 The Relationship model 840 A problem with the data model (and a solution) 840 User/relationship associations 850 Relationship validations 853 Followed users 855 Followers 859 A web interface for following users 862 Sample following data 862 Stats and a follow form 864 Following and followers pages 876 A working follow button the standard way 887 A working follow button with Ajax 892 Following tests 897 The status feed 899 Motivation and strategy 901 A first feed implementation 903 Subselects 907 Conclusion 913 Guide to further resources 913 What we learned in this chapter 915

قیمت نهایی

۴۹٬۰۰۰ تومان