-v
flag, 13
@user
variables, 338, 387, 388
<title>
tag, 135
&
(ampersands), 809
, (commas), 290
@import
function, 219
@session
variable, 387
&&
statements, 405
#
(pound sign), 166
==
operator, 254
>=
notation, 21
||=
(“or equals”) assignment operator, 404
About page
HTML (Hypertext Markup Language), 148
testing, 131
accessing
access control tests, 795
activation tokens, 563
friendly forwarding, 521
programmatic access, 746
protected pages, 512
synonyms, 178
user administrative, 747
activation edit
action, 590–594
adding, 602
authenticated?
method, 585–590
broken-up activation tests, 600–603
email, 568–585 (see also email)
refactoring activation code, 604–610
sending email, 618
Account dropdown menus, 413
adding, 245
create
, 346, 362, 382, 383, 391, 401, 493, 525, 581–585, 630–633, 696, 697, 698, 797
destroy
, 382, 383, 549–552, 696, 719, 797
edit
, 324, 494, 495, 561, 590–594, 623, 641–644
help
, 120
update
, 83, 501, 507, 561, 646
activated users, displaying, 608
activating Turbo, 800
Active Record, 98, 265, 273, 560
associations, 667
commands, 274
uniqueness validations, 297
where
method, 808
active relationships, 759, 760, 761
implementation, 764
interfaces, 728
validations, 733
active users, 607. See also users
Add user pages, navigating, 746
adding
account activation, 602
actions, 245
Amazon AWS storage, 749
authenticated?
method, 456
authorization, 697
belongs_to
method, 765
Bootstrap CSS, 219
CSS (Cascading Style Sheets), 219, 223, 224
delete links, 716
digest
method, 429
dynamic content, 107
extra size to cloud IDEs, 14
faker
gem, 533
feed instance variables, 709
files, 117
follow forms, 783
following
association, 768
following/follower relationships, 774
forget
method, 463
gravatar_for
helper, 530
inactive users, 609
indices, 762
irb configuration, 165
JavaScript, 413
length validations, 287
logged_in_user
method, 510
logos, 224
markup, 421
microposts, 683, 685, 699, 701, 721
options hashes, 335
password reset methods, 648
relationship model validations, 767
remember me checkboxes, 471, 472
remember
method, 451
repositories, 46
resized display images, 741
root routes for users, 81
routes to Contact pages, 244
session token methods on users, 488, 520
spacing, 221
status feeds, 710
store_location
method, 523
URLs (Uniform Resource Locators), 498, 530
@user
variables, 338
validations to images, 734
viewport meta
tags, 420
addresses
array, 288
admin
attribute, 545, 546, 548
advanced login, 445. See also login
login with remembering, 453–462
remember me checkboxes, 470–476
alert
method, 735
alerts, JavaScript, 737
allowing
connections, 113
empty passwords, 507
valid image formats, 736
Amazon Web Services. See AWS (Amazon Web Services)
ampersands (&
), 809
annotations, comments, 176
anonymous functions, 677
Application controllers, 31
Sessions helper module in, 399
Application helper, 254
ApplicationController
class, 101
design, 218
hello
, 3
layouts, 160 (see also layouts)
MVC (model-view-controller), 28–30
opening, 30
previewing, 26
profiles, 316 (see also profiles)
pushing, 114
site layouts, 146
strings, 167–174 (see also strings)
toy
, 4
toy demo, 65–66 (see also toy demo application)
viewing, 30
applying
flash, 74
Gemfiles
, 23
key–value pairs, 812
MiniMagick, 740
SendGrid, 611
SQLite, 110
architecture
MVC (model-view-controller), 32
REST (REpresentational State Transfer), 65, 83 (see also REST [REpresentational State Transfer])
arguments, 174
command-line, 119
defaults, 174
keywords, 336
addresses
, 288
mutating, 179
ascending order, 676
assert_difference
method, 553, 554
assert_select
method, 252, 253
assert_template
method, 251
assigns
method, 601
Active Record, 667
has_many
relationship, 764
searching microposts, 718
associative arrays, 185. See also hashes
attach
method, 729
attacks, sessions replay, 400
attributes
accessors, 202
adding activation, 563
password reset, 628
password_digest
, 539
authenticated?
method, 456, 468, 469, 585–590
authentication, 87, 263, 310–313
code, 432
before filters, 493
sessions, 382
users, 303
adding, 697
microposts, 694
models, 381
requiring logged-in users, 509–515
requiring the right user, 515–521
testing, 786
automatic destruction, 663
AWS (Amazon Web Services), 7, 8, 743, 744
adding, 749
buckets, 748
creating environments, 8
interfaces, 745
naming environments, 9
regions, 749
signup, 745
base titles, 161
bcrypt
function, 305, 306, 455
before_action
command, 509
before_save
callback, 564, 565
behavior, remember me, 445–470
belongs_to
method, 663, 670, 672, 765
BitBucket, 446
body
tag, 145
branches
configuring names, 38
breaking up long tests, 595–600
broken-up activation tests, 600–603
browser reload-page button, 47
browsers. See also interfaces
loading pages, 215
redirecting, 361
remember token cookies, 461, 462
remember where I left off feature, 437
buckets, AWS
Budri, Abdullah, 672
built-in classes, modifying, 197–199
bundle
command, 16
bundle config
command, 55
bundle install
command, 25
bundler
gem, 13
buttons
follow, 755 (see also following users)
unfollow, 759
caches, GitHub, 42
callbacks
defining, 300
implementation, 303
capybara
gem, 21
Cascading Style Sheets. See CSS (Cascading Style Sheets)
case sensitivity, testing, 296
cd
command, 14
CGI
module escapes, 574
chaining methods, 172
change
method, 268
checkboxes
nesting, 470
ApplicationController
, 101
container
, 214
CSS (Cascading Style Sheets), 211
defining, 195
hierarchies, 193
inheritance hierarchies, 196
instances, 193
MicropostController
, 101
TestCase
, 477
UsersController
, 100
ValidLogin
, 597
clicking menus, 424
closures, 183. See also blocks
cloud IDEs (Integrated Development Environments), 5, 107, 108
defaults, 12
downloading files, 269
login, 416
sizing, 14
Cloud9, 8. See also AWS (Amazon Web Services)
creating environments, 8
naming environments, 9
code
authentication, 432
avoiding repetition, 696
building microposts, 673
clients, 769
comments, 226
executing, 144
for failed logins, 397
generated code, 66
generating, 118
refactoring, 107
refactoring activation, 604–610
technical sophistication and, 6
templates, 607
testing, 127 (see also testing)
undoing, 118
URLs (uniform resource locators) forwarding, 523
viewing error messages, 353
writing small code, 66
colors
modifying, 225
synonyms, 225
columns, 265
command-line
arguments, 119
heroku
command-line interface, 56
Rails consoles, 165
terminals, 7
Unix, 2
commands
Active Record, 274
before_action
, 509
bundle
, 16
bundle config
, 55
bundle install
, 25
cd
, 14
commit
, 40
config:set
, 614
generate
, 665
git push
, 46
ls
, 41
mkdir
, 14
SQL (Structured Query Language), 274
which
, 739
commas (,), 290
comments
annotations, 176
authentication code, 432
code, 226
failing email tests, 582
filters, 513
moving, 167
Ruby, 166
uncommenting, 515
commit
command, 40
commit sequences, 117
config
directory, 120
config:set
command, 614
configuration, 5
applications (apps), 107–115, 611
AWS (Amazon Web Services), 744–748, 750
branch names, 38
email, 574
first-time repository setup, 39–41
first-time system setup, 37–39
indentation, 13
irb, 165
native systems, 6
saving passwords, 39
session tokens on login, 488
SSL (Secure Sockets Layer), 375
test domain hosts, 580
confirmation, 279
connections
SSL (Secure Sockets Layer), 374–376
consoles
defining classes, 195
container
class, 214
Content Security Policy. See CSP (Content Security Policy)
contents, listing, 41
control
flow, 171
application, 31
debuggers, 328
Micropost resource, 89
microposts, 694
rails, 29
Relationship, 796
relationship between models and, 84
show
action, 326
static pages, 122
conventions. See also guidelines
extra spaces, 186
names, 267
convert
command-line utility, 739, 740
cookies
encryption, 454
expiration, 454
sessions, 398
stealing, 446
temporary, 400
cookies
method, 446
copying comments, 167
correct_user
method, 517, 518, 519
cost parameters, 428
count
method, 683
create
action, 346, 362, 382, 383, 391, 401, 493, 696, 697, 698, 797
friendly forwarding, 525
create_activation_digest
method, 564
create_table
method, 268
create!
method, 534
created_at
method, 676
creating. See formatting
cross-site request forgery. See CSRF (cross-site request forgery)
cross-site scripting. See XSS (cross-site scripting)
cryptography, 446
CSP (Content Security Policy), 147
CSRF (cross-site request forgery), 147
CSS (Cascading Style Sheets), 2, 190–191, 207
classes, 211
error messages, 356
footers updating, 425
microposts, 687
remember me checkboxes, 473
Sass language (see Sass language)
sidebars, 334
signup forms, 339 (see also forms; signup)
users index, 530
curl
utility, 215
current_user
method, 402, 459, 460, 483, 484, 487
customization
Bootstrap CSS, 239
fixtures, 428
Gravatar (globally recognized avatar) images, 333
HTML (Hypertext Markup Language), 124
JavaScript, 415
rules, 222
data definition language. See DDL (data definition language)
data models
data validation, 86
data, showing, 777
communicating with objects, 99
ignoring files, 130
password resets, 622 (see also password reset)
production database configuration, 377–378
remember digests, 450
reset, 568
DB Browser, 270
DDL (data definition language), 265
debug
methods, 328
debugging
login, 390
decryption, 455
default_scope
method, 676
defaults
arguments, 174
cloud IDEs (Integrated Development Environments), 12
databases, 265
environments, 318
Gemfile
directory, 19
ordering, 663
Rails page, 31
README file, 48
routing files, 33
defining
callbacks, 300
classes, 195
gravatar_for
helper function, 330, 331, 336
relationship models, 760
root routes, 245
titles, 162
user actions/views, 326
variables, 238
delete links
adding, 716
Home pages, 721
mockups, 717
DELETE
requests, 121, 122, 382, 383, 408, 549
exceptions, 486
microposts, 718
posts, 722
relationship fixtures, 767
user mismatches, 723
deployment
production database configuration, 377–378
production deployment, 378–379
production web servers, 376–377
SSL (Secure Sockets Layer), 374–376
users, 81
design. See also layouts
applications (apps), 218
encryption, 304
destroy
action, 382, 383, 549–552, 696, 719, 797
destroying
automatic destruction, 663
sessions, 438
developer tools, Safari, 417, 418, 419
development, 2. See also web development
email settings in, 574
environments, 7, 166 (see also IDEs [Integrated Development Environments])
native systems, 6
RESTful style of, 84
Devise gem, 263
digests
passwords, 456
directories
config
, 120
environment
, 14
displaying. See also viewing
activated users, 608
error messages, 353
sizing, 739
do
keyword, 342
doctypes, 210
documents
Active Storage, 727
types, 137
domain hosts, 580
Don’t Repeat Yourself principle. See DRY (Don’t Repeat Yourself) principle
downcasing email, 302
downloading
files, 269
fixture images, 732
images, 217
DRY (Don’t Repeat Yourself) principle, 142, 422
duck typing, 277
duplicate email addresses, 294
duplicate feed items, testing, 819
dynamic content
adding, 107
edit
action, 324, 494, 495, 561, 623
editing. See also updating users
Gravatar (globally recognized avatar) images, 505
successful edits (with TDD), 505–509
users, 703
efficiency in production, 234
elements, synonyms, 178
email
attribute, 284, 285, 287, 301
emails. See also uniqueness validations
configuration, 574
downcasing, 302
duplicate email addresses, 294
indexes, 298
invalid addresses, 633
password resets, 622 (see also password reset)
in production, 610–618, 658–659
sending, 604
testing case sensitivity, 296
testing valid user, 432
tests, password resets, 640–641
updating create
action, 581–585
validation, 289
embedded Ruby. See ERb (embedded Ruby)
empty (nil
) passwords, 357
empty passwords, updating, 507
encryption. See also security
cookies, 454
passwords, 304
environment
directory, 14
environments. See also cloud IDEs (Integrated Development Environments)
creating, 8
defaults, 318
development, 166
naming, 9
ERb (embedded Ruby), 142–149, 234, 539, 788
flash messages, 373
templates, 680
microposts, 702
errors
refreshing, 715
routing, 714
updating, 703
escape
method, 574
escaping emails, 574
evaluation, short-circuit, 405
exceptions, 276
deleting, 486
untested branches, 484
executing code, 144
expiration
cookies, 454
password resets, 627
explicit calls, 788
explicit versions, 22. See also versions
expressions
regular, 290
Rublar regular expression editor, 292
extra spaces, conventions, 186
Ezeilo, Sunday Uche, 769
Fahnestock, Jack, 461
failures. See also troubleshooting
microposts, 710
password reset, 649
signup (see unsuccessful signups)
faker
gem, 533
feed
method, 706
feeds
adding instance variables, 709
microposts, 706
proto-feeds, 717 (see also proto-feeds)
status, 693, 707, 709, 710, 805–821 (see also status feeds)
Fielding, Roy, 83
fields, hidden, 642
files, 19. See also directories
adding, 117
adding JavaScript, 413
adding Users resources, 324
downloading, 269
fixtures, 516 (see also fixtures)
helper, 162
ignoring database, 130
layouts, 146
LICENSE, 110
migrations, 267
missing, 42
README, 110, 111 (see README file)
routes, 119
routing, 33
filesystem navigators, 7
filters
comments, 513
uncommenting, 515
Find in Files global search, 7
finding. See searching
finished signup forms, 362–364
first-time repository setup, 39–41
first-time system setup, 37–39
activating users, 567
downloading images, 732
following/follower tests, 792
testing user logins, 429
flash
applying, 74
follow buttons, 755
working follow buttons, 794–802
follow
method, 796
followers
tables, 758
following
association, 768, 770
adding statistics, 779
following/followers pages, 785–794
relationship models, 756–773 (see also relationship models)
sample following data, 774–775
testing authorization, 786
user/relationship associations, 763–766
users to follow, 757
working follow buttons, 794–802
following_ids
method, 810
footers
mobile styles, 426
updating, 425
foreign keys, 764
forget
method, 463
forgot passwords, 621–623, 630, 633. See also password reset; passwords
form
tag, 345
format validations, 279, 288–294
formatting
mockups (see mockups)
relationships, 759
static pages, 115
titles, 161
users, 746
working follow buttons, 794–802
forms
adding images, 728
adding remember me checkboxes, 471, 472
creating microposts, 700
creating new password resets, 624
errors, 706
finished signup forms, 362–364
forgot password, 623, 624, 630, 633
HTML (Hypertext Markup Language), 342–346
microposts, 705
mockups (see mockups)
passwords, 344
signup, 315, 337–346 (see also signup)
unfollow, 782
viewing, 339
forwarding
URLs (uniform resource locators), 523, 524
frameworks
Bootstrap CSS (see Bootstrap CSS)
CSS (Cascading Style Sheets), 207 (see also CSS [Cascading Style Sheets])
full-table scans, 298
functionality, 123
functions, 123. See also methods
anonymous, 677
gravatar_for
helper function, 330, 331, 336
helpers (see helpers)
@import
, 219
provide
, 143
Gemfile versions, 22
Gemfiles
, applying, 23
gems
bundler
, 13
bundling without, 56
capybara
, 21
Devise, 263
faker
, 533
updating, 110
versions, 22
generalizing authenticated?
method, 585–590
generate
command, 665
generated code, 66
generated migrations, 448
generated static pages, 116–124
generating
code, 118
sessions controllers, 383
tokens, 449
User mailer previews, 575
User models, 267
GET
request, 121, 122, 323, 383, 625
get
rules, 246
getter methods, 202
Git
applying version control, 41–42
first-time repository setup, 39–41
first-time system setup, 37–39
toy demo application, 68 (see also toy demo application)
upgrading, 37
git branch
command, 49, 51, 52
git push
command, 46
browser reload-page button, 47
passwords, 45
private repositories, 45
push templates, 44
repositories, 46 (see also repositories)
globally recognized avatar, 328. See Gravatar (globally recognized avatar) images
Gómez, Jose Carlos Montero, 500
graphical user interfaces. See GUIs
Gravatar (globally recognized avatar) images, 330–336, 505
customization, 333
profiles, 332
gravatar_for
helper, 330, 331, 336, 530
grep
utility, 611
guidelines
titles, 161
GUIs (graphical user interfaces), 15, 29. See also interfaces
Hansson, David Heinemeier, 2, 65
has_many
:through
association, 767, 768
has_many
relationships, 663, 670, 673, 756, 763
has_secure_password
method, 303, 306–308, 310, 312
hash mark (#
), 166
adding options, 530
nested, 188
headers, partials, 226, 228, 249
hello
app, 3
help
action, 120
Help page
custom HTML (Hypertext Markup Language), 125
helpers, 342
Application, 254
files, 162
gravatar_for
, 330, 331, 336, 530
image_tag
, 214
sessions, 399
testing, 164
SSL (Secure Sockets Layer), 374, 375
heroku
command-line interface, 56
hexdigest
method, 330
hidden fields, 642
hiding images, 226
hierarchies
classes, 193
Home pages
activation messages, 583
adding microposts, 699
adding statistics, 779
custom HTML (Hypertext Markup Language), 124
debug information, 320
delete links, 721
form errors, 706
HTML (Hypertext Markup Language), 136, 147
micropost forms, 705
Next links, 713
proto-feeds, 711
root routes, 150
hosts, domains, 580
Hotwire, 2, 348, 411, 755, 778
working follow buttons, 797–802
HTML (Hypertext Markup Language), 115
About page, 148
account activation, 573
customization, 124
login forms, 389
previews, 577
stylesheets, 227
testing, 818
HTTP (Hypertext Transfer Protocol), 121, 381, 382
operations, 122
verbs, 120
HTTP_REFERER, 719
Hypertext Markup Language. See HTML (Hypertext Markup Language)
Hypertext Transfer Protocol. See HTTP (Hypertext Transfer Protocol)
IAM (Identity and Access Management), 9, 744
Identity and Access Management. See also IAM (Identity and Access Management)
IDEs (Integrated Development Environments), 5
provisioning, 11
IE (Microsoft Internet Explorer), 211
image_tag
helper, 214
images
allowing valid formats, 736
downloading fixtures, 732
Gravatar (globally recognized avatar), 505
hiding, 226
importing, 736
processing, 740
searching, 215
implementation
active relationships, 764
callbacks, 303
Hotwire, 778
user following, 761
implicit returns, 175
importing
images, 736
JavaScript, 415
inactive users, adding, 609
includes
method, 814
incompatibilities, 24
indentation, configuring, 13
index
action, 80, 84, 85, 527, 529
indices
adding, 762
index pages user resource, 75
Micropost model migrations, 665
microposts, 91
multiple key indexes, 666
with pagination, 537
refactoring, 542
users, 86
initialization
hashes, 273
objects, 273
injection, SQL (Structured Query Language), 708
input
tag, 783
installation, 5
confirmation, 13
installation commands, 411, 412
instances
classes, 193
variables, 202
Integrated Development Environments. See IDEs (Integrated Development Environments)
integration
testing, 128, 207, 251, 505, 554, 724, 790
troubleshooting, 113
interfaces
Active Storage, 728
AWS (Amazon Web Services), 745
following users, 774–805 (see also following users)
following/followers pages, 785–794
Gravatar (globally recognized avatar) images, 505
GUIs (graphical user interfaces), 15, 29
heroku
command-line, 56
microposts, 724
working follow buttons, 794–802
internals links, 229
Internet, downloading images from, 217
interpolation, 167
invalid email addresses, 633
invalid images, uploading, 735
invalid information, submitting, 352
invalid input, login, 389
invalid login, 439
invalid submissions, 358–361, 723
invalidity, 290. See also validity
irb
configuration, 165
JavaScript, 2
alerts, 737
customizing, 415
importing, 415
preventing uploading of images, 736
refactoring code, 427
key–value pairs, 812
keys, 185
foreign, 764
multiple key indexes, 666
symbols as, 187
keywords
arguments, 336
do
, 342
private
, 565
return
, 469
lambdas, 677
languages, Sass. See Sass language
large files, JavaScript alerts for, 737
layouts, 87
applications (apps), 160
files, 146
footers, 426
navigating, 207
updating, 209
length
minimum standards for passwords, 308–310
length
method, 586
LICENSE file, 110
line continuations, 564
links
adding, 209
adding delete, 716
adding URLs (Uniform Resource Locators), 530
footer partials with, 249
forgot password, 622
header partials with, 249
internals, 229
mailing account activation, 571
mapping routes/URLs, 243
microposts, 690
Next, 713
pagination, 715
lists
contents, 41
ordered, 681
unordered, 213
literal constructors, 192
literal strings, 167. See also strings
local variables, 450
local web servers, allowing connections, 113
log_in_as
method, 478–479, 516
logged_in_user
method, 510, 695, 696
logged-in users, requiring, 509–515, 528
logging out
if logged in, 468
account activation, 559–560 (see also account activation)
cloud IDEs (Integrated Development Environments), 416
debugging, 390
forgot password links, 627
HTML (Hypertext Markup Language), 389
invalid, 439
invalid input, 389
login with remembering, 453–462
modifying layout links, 406–410
with new navigation links, 411
preventing inactivated users, 593
redirecting, 524
refactoring tests, 597
remember me checkboxes, 470–476
remember where I left off feature, 437
remembering users, 457
Safari developer tools, 417, 418, 419
safe navigation, 433
session tokens, 488
status, 435
test users, 512
testing, 436
testing layout changes, 427–433
user profile mockups, 407
validity, 389
logos
adding, 224
styles, 225
lorem ipsum text, 316
Lorem.sentence
method, 685
ls
command, 41
mail
method, 571
mailers
mapping
routes, 243
URLs (uniform resource locators), 79, 243
markup, adding, 421
matching patterns, 290
:member
method, 776
menus
Account dropdown, 413
adding JavaScript, 413
clicking, 424
dropdown, 416
messages. See also email
activation, 583
error, 94, 284 (see also error messages)
sending, 586
warning, 593
metaprogramming, 586
adding session token methods to users, 488, 520
alert
, 735
assert_template
, 251
assigns
, 601
attach
, 729
authenticated?
, 456, 468, 469, 585–590
built-in Rails, 160
chaining, 172
cookies
, 446
count
, 683
create_activation_digest
, 564
create_table
, 268
create!
, 534
created_at
, 676
current_user
, 402, 459, 460, 483, 484, 487
debug
, 328
default_scope
, 676
feed
, 706
follow
, 796
following_ids
, 810
forget
, 463
getter, 202
has_secure_password
, 303, 306–308, 310, 312
hexdigest
, 330
includes
, 814
length
, 586
login status, 435
Lorem.sentence
, 685
mail
, 571
microposts, 672
paginate
, 537
passing messages, 171
password reset, 631
password_reset
, 569
password_reset_expired?
, 648
patch
, 504
PATCH
, 493
pluralize
, 700
push
, 179
puts
, 168
redirect_to
, 362
referrer
, 719
root
, 246
save
, 273
send
, 586
setter, 202
setup
, 281, 307, 514, 595, 596, 597, 600, 601, 667, 668, 673
show_follow
, 789
split
, 177
store_location
, 523
unfollow
, 796
upcase
, 296
User.digest
, 560
user.forget
, 462
User.new_token
, 560
user.remember
, 453
user/active relationship association, 765
utility, 770
variant
, 741
Micropost resource, 87–104. See also microposts
controllers, 89
inheritance hierarchies, 98–104
Restful routes, 89
MicropostController
class, 101
accessing, 96
adding, 683, 685, 699, 701, 721
associations, 95, 670–674, 791
authorization, 694
controllers, 694
CSS (Cascading Style Sheets), 687
deleting, 718
failures, 710
feeds, 706
forms, 705
image upload in production, 742–752
images, 726–752 (see also images)
indexes, 91
interfaces, 724
length of posts, 91–93 (see also mic)
methods, 672
ordering, 677
pagination links, 690
partials, 716
refactoring, 673
Restful routes, 694
searching, 718
testing, 667, 668, 690–693, 720–726
toy demo application, 71
:microposts
symbol, 763
microposts
table, 808
Microsoft Internet Explorer. See IE (Microsoft Internet Explorer)
account activation, 564
email uniqueness, 298
files, 267
generated, 448
Micropost models, 665
password reset attributes, 628
passwords, 305
relationships
tables, 762
running, 269
undoing, 119
User model, 268
MiniMagick, 740
minimum standards for passwords, 308–310
mismatches, users, 723
missing files, 42
mixin facility (Sass language), 340
mkdir
command, 14
mobile styling, login, 415–427
mockups
creating microposts, 698
delete links, 717
forgot password forms, 623, 624
forgot password link, 622
login failures, 386
login forms, 383
profile pages with microposts, 680
profiles, 315, 316, 407 (see also profiles)
proto-feeds, 707
remember me checkboxes, 471
results of visiting protected pages, 510
signup, 338
stats partials, 776
status feeds, 806
uploading images, 727
user edit pages, 494
user followers pages, 787
user following pages, 786
user index pages, 527
users index with delete links, 545
model-view-controller. See MVC (model-view-controller)
adding secure passwords, 303–313
creating user objects, 272–275
uniqueness validations, 294–303
updating user objects, 277–279
authorization, 381
data, 70–71 (see also data models)
inheritance, 98 (see also inheritance)
Microposts, 663–679 (see also microposts)
relationship, 84, 756–773 (see also relationship models)
security, 513
modifying
colors, 225
root routes, 36
modules, 399
Moor, Andrew, 518
moving comments, 167
multiple key indexes, 666
mutating arrays, 179
MVC (model-view-controller), 28–30
architecture, 32
in Rails, 82
names
conventions, 267
environments, 9
nano
text editors, 165
native system configuration, 6
navigating
Add user pages, 746
layouts, 207
safe navigation, 433
navigators
cloud IDEs (Integrated Development Environments), 7
filesystems, 7
Find in Files global search, 7
nested hashes, 188
nesting
checkboxes, 470
new
action, 338, 382, 383, 493, 623
new hotness problems, 2
new password resets, 627–630. See also password reset
new_token
method, 572
Next links, 713
nil
(empty) passwords, 357
notation
>=,
21
numbers
Gemfile versions, 22
object-oriented programming. See OOP (object-oriented programming)
objects, 29
communicating with databases, 99
initializing, 273
user (see user objects)
OOP (object-oriented programming), 98
opening
applications (apps), 30
terminal tabs, 27
operators
==, 254
or equals (||=) assignment, 404
options hashes, adding, 335, 530
or equals (||=) assignment operator, 404
ordered lists, 681
ordering
ascending order, 676
defaults, 663
microposts, 677
testing, 675
output
paginate
method, 537
pagination
links, 715
microposts, 690
panes, splitting, 280
parameters
cost, 428
queries, 572
strong, 547
microposts, 716
passive relationships, 759, 760
attributes, 628
digests, 657
failures, 649
HTML (Hypertext Markup Language), 635, 636
invalid email addresses, 633
links, 626
methods, 631
plain-text email templates, 635
requests, 627
submitting, 638
views, 629
password_digest
attribute, 539
password_reset
method, 569
password_reset_expired?
method, 648
passwords
bcrypt
, 455
digests, 456
empty (nil
), 357
encryption, 304
fixtures, 428
GitHub, 45
migrations, 305
minimum standards for, 308–310
remember tokens, 449
reset (see password reset)
saving, 39
signup forms, 344
testing, 308
updating, 507
pasting comments, 167
patch
method, 504
patterns, matching, 290
persistent sessions
logging out, 464
testing, 485
Philips, Andy, 304
placeholders, views as, 124
plain-text email templates, 635
planning toy demo applications, 66–70
pluralize
method, 700
pluralize
text helper, 355, 356
POST
request, 121, 122, 346, 359, 383, 493, 625
posts, deleting, 722
pound sign (#
), 166
prefills, edit pages, 497
preprocessor engines, 234
presence validations, 99, 279, 282–285
previewing
applications (apps), 26
HTML (Hypertext Markup Language), 577
primary keys, 73
private
keyword, 565
private repositories, 45
Proc (procedure), 677
processing images, 740
production, 166
AWS (Amazon Web Services), 748–752
database configuration, 377–378
efficiency in, 234
professional-grade deployment, 374–379
production database configuration, 377–378
production deployment, 378–379
production web servers, 376–377
SSL (Secure Sockets Layer), 374–376
profiles, 316. See also signup
account activation, 592
adding statistics, 783
follow buttons, 784
Gravatar (globally recognized avatar) images, 332
mockups, 407
sidebars, 700
unfollow buttons, 785
users, 756
viewing, 420
programmatic access, 746
protected pages, accessing, 512
protocols
HTTP (Hypertext Transfer Protocol), 120, 121, 122, 381, 382
stateless, 381
provide
function, 143
provisioning IDEs (Integrated Development Environments), 11
push
method, 179
push sequences, 117
push templates, 44
push, README files, 52
pushing applications (apps), 114
puts
method, 168
queries
parameters, 572
problems, 814
Rails
activating Turbo, 800
controllers, 29
debugger prompt in, 328
directory structures, 18
MVC (model-view-controller), 28–30, 82
shortcuts, 117
toy demo application, 65–66 (see also toy demo application)
rails new
command, 14, 16, 66, 136
rails test
, running, 164
Rails-flavored Ruby, 159
CSS (Cascading Style Sheets), 190–191
strings, 165–174 (see also strings)
raw home view, 121
rdbg
(Ruby debugger), 328
defaults, 48
push, 52
record, Active Record, 98, 265, 273, 274, 276–277, 560. See also Active Record
Red, Green, Refactor cycle, 130–135, 136
redirect_to
method, 362
redirecting
browsers, 361
index
action, 527
login, 524
redundancy, data models and, 758
refactoring, 107
JavaScript, 427
microposts, 673
Red, Green, Refactor cycle, 130–135
testing logout, 441
references, methods, 564
referrer
method, 719
refreshing errors, 715
regex validations, 291
regions, AWS (Amazon Web Services), 749
regressions, 127
regular expressions, 290
Rublar regular expression editor, 292
Relationship controller, 796
relationship models, 84, 756–773
adding indices, 762
defining, 760
testing, 766
user/relationship associations, 763–766
relationships
access control tests, 795
adding following/follower, 774
following/follower tests, 792
formatting, 759
has_many
, 663, 670, 673, 756, 763, 764
routes, 782
Turbo templates, 801
working follow buttons, 794–802
relationships
tables, 762
remember me, 560
login with remembering, 453–462
remember where I left off feature, 437
remember_digest
attribute, 447, 448
remote origin, 43
rendering
README files, 48
user signup errors, 702
repositories
adding, 46
first-time repository setup, 39–41
private, 45
toy demo application, 68 (see also toy demo application)
viewing, 47
representational state transfers. See REST
requests
password resets, 622, 627 (see also password reset)
POST, 121, 122, 346, 359, 383, 493, 625
protocols, 381 (see also protocols)
requiring
reset
databases, 568
passwords (see password reset)
resources
Micropost resource (see Micropost resource)
microposts (see microposts)
REST (REpresentational State Transfer), 759
RESTful, 382
Users, 322–327 (see Users resource)
respond_to
method, 799, 803, 804
REST (REpresentational State Transfer), 65, 83, 115, 122, 315, 322
resources, 759
RESTful resources, 382
Account Activation resource, 561
custom rules in resources, 777
microposts, 694
password resets, 625
resubmitting. See also forms; submitting unsuccessful signups, 347
return
keyword, 469
returns, implicit, 175
root
method, 246
root routes
modifying, 36
root routes for users, adding, 81
root URLs, 33
routes
adding, 562
adding Users resources, 324
mapping, 243
relationships, 782
root (see root routes)
session rules, 384
signup, 258
static pages, 247
routes files, updating, 119
errors, 714
files, 33
modifying root routes, 36
Rublar regular expression editor, 292
Ruby
classes, 81, 192–204 (see also classes)
comments, 166
Ruby debugger (rdbg
), 328
Ruby Version Manager. See rvm
(Ruby Version Manager)
RubyGems package manager, 12
rules
CSS (Cascading Style Sheets), 208, 222
get
, 246
sessions, 384
running
migrations, 269
rails new
command, 16
rails test
, 164
rvm
(Ruby Version Manager), 10
S3 (Simple Storage Service), 743, 750
Safari developer tools, 417, 418, 419
safe navigation, 433
samples
sandboxes, 272
mixin facility, 340
save
method, 273
saving
before_save
callback, 564, 565
passwords, 39
scalability, 2
scripts, generating, 72
sidebars, 779
searching
Find in Files global search, 7
images, 215
microposts, 718
users to follow, 757
secure passwords, adding, 303–313
security
models, 513
seed users, activating, 566
selecting Ubuntu Servers, 10, 14
send
method, 586
SendGrid, 611, 613, 614, 615, 616, 617
sending
email, 604
messages, 586
servers, 121
allowing connections, 113
sharing, 29
Ubuntu (see Ubuntu Servers)
session
method, 400, 446, 477, 478
sessions
adding token methods on users, 488, 520
authentication, 382
cookies, 398
create
action, 391
destroying, 438
helpers, 399
logging out from persistent, 464
replay attacks, 400
simulating, 406
testing, 485
tokens, 488
setter methods, 202
settings. See also configuration
indentation, 13
setup. See also configuration
setup
method, 281, 307, 514, 595, 596, 597, 600, 601, 667, 668, 673
sharing servers, 29
shim stylesheets, 227
short-circuit evaluation, 405
shortcuts, Rails, 117
show_follow
method, 789
showing
data, 777
paginating user output, 535–539
users, 316–336 (see also users)
users following, 790, 791, 792
side effects, 168
CSS (Cascading Style Sheets), 334
SCSS, 779
styles, 335
templates, 725
user info, 700
signing cryptography, 446
account activation, 581 (see also account activation)
activation messages at, 583
AWS (Amazon Web Services), 745
finished signup forms, 362–364
HTML (Hypertext Markup Language), 342–346
passwords, 344
production database configuration, 377–378
production deployment, 378–379
production web servers, 376–377
professional-grade deployment, 374–379
rendering user errors, 702
SendGrid, 613
SSL (Secure Sockets Layer), 374–376
testing for valid submission, 369–373
URLs (uniform resource locators), 257–260
views, 500
signups
testing for invalid submissions, 358–361
Simple Storage Service. See S3 (Simple Storage Service)
simulating sessions, 406
single-quoted strings, 169–170
site layouts, applications (apps), 146
sizing
cloud IDEs (Integrated Development Environments), 14
displaying, 739
slightly dynamic pages, 135–142
spacing, adding, 221
split
method, 177
splitting panes, 280
SQL (Structured Query Language), 96, 265
commands, 274
injection, 708
SSL (Secure Sockets Layer), 374–376
stabby lambdas, 677
staging areas, 40
starting
stateless protocols, 381
statements, &&, 405
classes, 199
configuring root routes, 149–152
controllers, 122
formatting, 115
generated static pages, 116–124
Red, Green, Refactor cycle, 130–135
routes, 247
slightly dynamic pages, 135–142
updating, 160
statistics
viewing, 777
status feeds, 693, 707, 709, 710, 805–821
Home pages, 816
testing, 807
testing duplicate feed items, 819
testing HTML, 818
status, login, 435
Stimulus, 411
storage
Active Storage, 749 (see also Active Storage)
adding Amazon AWS, 749
URLs (uniform resource locators) forwarding, 523
store_location
method, 523
strategies, status feeds, 806–808
strings
keys, 185
literals, 167
matching patterns, 290
strong parameters, 547
Structured Query Language. See SQL (Structured Query Language)
structures
styles, 87
footers, 426
logos, 225
sidebars, 335
stylesheets
HTML (Hypertext Markup Language), 227
partials, 226
subdirectories, 29. See also directories
valid submissions, 723
submitting
invalid information, 352
invalid submissions, 723
microposts with images, 731
password resets, 638
remember me checkboxes, 474
testing for invalid submissions, 358–361
testing for valid submission, 369–373
successful edits (with TDD), 505–509
successful signup
testing for valid submission, 369–373
symbol-to-proc, 183
synonyms, 178
colors, 225
syntax, nesting, 236
tables, 266. See also databases
DB Browser, 270
followers
, 758
microposts
, 808
relationships
, 762
users
, 266
tabs, opening, 27
tags
body
, 145
form
, 345
input
, 783
<title>
, 135
users, 747
TDD (test-driven development), 2, 127, 207
split panes, 280
successful edits with, 505–509
Tech Support Cheat Sheet, 6
technical sophistication, 6, 18, 84, 307, 321
templates
code, 607
ERb (embedded Ruby), 680
errors, 363
instance variables, 482
push, 44
remember me tests, 483
sidebars, 725
testing image uploads, 732
tests of error messages, 361
Turbo, 801
update_columns
method, 655–656
temporary cookies, 400
terminal tabs, opening, 27
terminals, command-line, 7
ternary operators, 428, 474, 475
test suites, 126
test-driven development. See TDD
TestCase
class, 477
About page, 131
access control tests, 795
admin
attribute, 548
authorization, 786
automated, 126
automated testing, 107
broken-up activation tests, 600–603
case sensitivity, 296
duplicate email addresses, 294
duplicate feed items, 819
editing for wrong users, 516
email formats, 289
following/follower pages, 793
friendly forwarding, 522
helpers, 164
HTML (Hypertext Markup Language), 818
index
action, 527
integration, 128, 207, 251, 505, 554, 724, 790
invalid login, 439
for invalid submissions, 358–361
login, 436
login status, 435
microposts, 667, 668, 690–693, 720–726
ordering, 675
palindromes, 176
passwords, 308
persistent sessions, 485
refactoring activation code, 604–610
relationship models, 766
security models, 513
status feeds, 807
user logout, 439
User model, 281
valid user email, 432
text
Micropost models, 664 (see also microposts)
nano
, 165
timestamps, account activation, 591
titles
base, 161
defining, 162
tokens
accessing activation, 563
adding session token methods to users, 488, 520
generating, 449
password resets, 622 (see also password reset)
sessions, 488
tools
command-line, 15 (see also command-line)
development, 8
indexes, 298
Safari developer, 417, 418, 419
touch
trick, 219
toy
app, 4
Micropost resource, 87–104 (see also microposts)
MVC (model-view-controller), 77–86
repositories, 68
User model for, 85
weaknesses of User resource, 86–87
tracking remember me behavior, 445–470
transactions, 381. See also protocols
transfers, representational state, 83
troubleshooting
integration, 113
unfollow buttons, 759
activating, 800
templates, 801
Ubuntu Servers, 8
uncommenting, 515
undoing
code generation, 118
migrating, 119
unfollow buttons, 759
unfollow
method, 796
uniqueness validations, 279, 294–303
Active Record, 297
Unix command lines, 2
unordered lists, 213
unsuccessful edits
unsuccessful signups, 346–361. See also signup
debugging, 349
testing for invalid submissions, 358–361
upcase
method, 296
update
action, 83, 501, 507, 561, 646
update_columns
method, 655–656
authenticated?
method, 469
edit pages prefills, 497
empty passwords, 507
errors, 703
footers, 425
gems, 110
layouts, 209
passwords, 506
routes files, 119
session controllers, 384
static pages, 160
successful edits (with TDD), 505–509
testing unsuccessful edits, 503–504
Users controllers, 258
upgrading Git, 36
upload fields, adding images to, 729
uploading images, 726–733, 735
URLs (uniform resource locators)
adding, 530
root, 33
routing, 325
Users resource and, 73
user administrative access, 747
User mailer
previews, 575
account activation, 566
adding activation methods, 604
adding password reset methods, 648
authenticated?
method, 456
following
association, 768
forget
method, 463
migrating, 268
password reset attributes, 628
password reset methods, 631
presence validations, 99
remember_digest
attribute, 447
testing, 281
validations, 502
user objects
User resource, weaknesses of, 86–87
user tours, toy demo application, 73–76
User.digest
method, 560
user.forget
method, 462
User.new_token
method, 560
user.remember
method, 453
users
account activation, 559–560 (see also account activation)
activating fixtures, 567
activating seed, 566
adding root routes for, 81
adding session token methods to, 488, 520
authentication, 303
authorization, 509–526 (see also authorization)
deleting, 544–555 (see also deleting users)
deploying, 81
edit pages, 78
editing, 703
finding to follow, 757
fixtures, 428
following, 755–756, 790, 791, 792 (see also following users)
formatting, 746
inactive, 610
index page, 80
indexes, 86
info sidebars, 700
login, 381, 401 (see also login)
microposts (see microposts)
mismatches, 723
modeling (see modeling users)
paginating user output, 526, 535–539
profiles, 316, 756 (see also profiles)
remembering, 457 (see also remember me)
requiring logged-in, 528
requiring the right user, 515–521
routes, 782
searching microposts, 718
signup pages, 255–260, 264 (see also signup)
tags, 747
updating, 493–494 (see also updating users)
Users controllers, 82–83, 255–257
show
action, 326
adding, 327
index pages, 75
RESTful routes, 84
URLs (uniform resource locators) and, 73
users
tables, 266
UsersController
class, 100
UsersLoginTest
, 600
utilities. See also tools
convert
command-line, 739, 740
curl
, 215
grep
, 611
utility methods, 770
valid image formats, allowing, 736
valid submissions, 723
valid user email, testing, 432
validation
Active Storage, 733
adding to images, 734
data, 86
regex, 291
User model, 502
validity, 273
login, 389
microposts, 667
ValidLogin
class, 597
values, 188
variables
adding feed instance, 709
defining, 238
local, 450
@session
, 387
variant
method, 741
verbs, HTTP (Hypertext Transfer Protocol), 120
versions
applying version control, 41–42
gems, 22
installing Rails, 12
viewing
applications (apps), 30
error messages, 353
forms, 339
hello, world!, 34
repositories, 47
statistics, 777
user information, 326
users, 322
viewports, 419
account activation, 573
Contact pages, 245
password reset, 629
raw home, 121
signup, 500
user edit, 496
user profiles, 420
users index, 529
violations, 279
warning messages, 593
web applications, 1. See also applications
strings, 167–174 (see also strings)
web development, 1
web interfaces
following users, 774–805 (see also following
users)
following/followers pages, 785–794
sample following data, 774–775
working follow buttons, 794–802
web pages, HTML (Hypertext Markup Language), 136–138
web servers
allowing connections, 113
WebSockets, 798
which
command, 739
wireframes, 208
YAML (YAML Ain’t Markup Language), 321
zero-offset, 178
18.220.65.61