Index

Symbols

-, 674, 695, 764

[], 149, 443, 631

`, 713

+, 674, 695, 764

<<, 199, 214, 215, 237

<=>, 683, 725, 764, 775

=~, 775

===, 764

A

abstract_class=, 166, 286

accepts_nested_attributes_for, 362365

acronym, 707708

Action Controller

callbacks, 116121

around, 119120

classes 118

conditions, 120121

halting, 121

inline method, 118

inheritance, 116117

ordering, 118119

skipping, 120

communication with view, 115

controller specs, 601604

layouts, specifying, 111

postbacks, 381

rendering, 102111

standard RESTful actions, 6973

streaming content, 121126

variants, 126127

verify method, 117

Action Dispatch, 99102

Action Mailer, 493504

attachments, 497498

callbacks, 499500

custom email headers, 495

generating URLs inside messages, 498

handing inbound attachments, 500501

HTML messages, 496

mailer layouts, 498499

models, 494500

multipart messages, 497

preparing outbound messages, 494496

previews, 503504

raising delivery errors, 21

receiving, 500501

sending, 499

server configuration, 502

SMTP, 493, 502

testing with RSpec, 502503

Action View, 313329

conditional output, 316317

customizing validation error output, 337338

ERb. See ERb

filename conventions, 314

flash messages, 321322

Haml. See Haml

Helpers. See Helpers

instance variables, 318320

layouts, 314315

logging, 328

partial_counter variable, 328

partials. See Partials

rendering 327

view specs, 604605

yielding content, 315316

Active Model, 625649

AttributeMethods module, 625627

Callbacks module, 627629

Conversion module, 629

Dirty module, 629631

Errors class, 631635

ForbiddenAttributesError, 635

Model, 635636

Naming module, 636638

SecurePassword, 638

serialization, 638640

testing compatibility of custom classes with Lint::Tests, 635

translation, 640641

Validations module, 641649

Active Record

abstract base models, 286287

associations, 121, 195240

:counter cache option, 207208

:counter sql option, 200

:dependent option, 201, 208, 235

:finder sql option, 200

AssociationProxy class, 239240

belongs_to. See belongs_to associations

destroying records, 201

extensions, 238239

foreign-key constraints, 292

has_and_belongs_to_many. See has_and_belongs_to_many associations

has_many. See has_many associations

has_many :through. See has_many :through associations

indexing, 509

many-to-many relationships, 222233

one-to-many relationships, 196204

one-to-one relationships, 233236

polymorphic, 287290

size of, 202

unique sets, 232233

unsaved objects, 236238

attributes, 133137

readonly, 149150

reloading, 142

serialized, 136137

translation, 640641

typecasting, 142

updating, 145147

Base class, 120

basic object operations, 138151

calculation methods, 278279

callbacks, 268278

cloning, 142143

concurrency. See Database locking

configuration, 171

find_by_sql method, 143144

legacy naming schemes, 133

migrations, 173194

column type mappings, 182183

creating, 173187

magic timestamp columns, 186187

schema.rb file, 189190

sequencing, 174

model specs, 599601

pattern, 129

query caching, 144145

querying, 155165

arel_table, 165

exists, 160

extending, 160

from, 159160

group, 160161

having, 161

includes, 161162

joins, 162

limit, 158159

none, 162

offset, 158159

order, 157158

readonly, 163

references, 163

reorder, 163164

reverse_order, 164

select, 159

unique, 164

unscope, 164165

where, 155165

RecordInvalid exception, 252253

RecordNotSaved exception, 200201, 271

records

deleting, 150151

random ordering, 158

touching, 149

scopes, 263268

session store, 1415, 450455

STI (Single-Table Inheritance), 280287

translations, 413417

validations, 241263

common options, 253254

conditional validation, 255256

contexts, 256

custom macros, 258259

declarative, 242253

errors, 241242, 261

enforcing uniqueness of join models, 250251

reporting, 332335

short-form, 256258

skipping, 260261

testing with Shoulda, 262

value objects, 299302

Active Support, 651780

active?, 170

acts_like?, 673674, 682, 738, 750, 764

adapter_name, 170

add, 632

add_column, 181182, 187, 197

added?, 632

add_index, 179

add_on_blank, 632

add_on_empty, 632

add_silencer, 12, 658

advance, 674, 683, 764

after, 580581

after_add, 214

after_commit, 270

after_create, 270

after_destroy, 258, 262, 270, 274

after_filter, 473474

after_find, 269, 274275, 297

after_fork, 539

after_initialize, 137, 269, 274276

after_remove, 215

after_rollback, 270

after_save, 270

after_touch, 270

after_update, 270

after_validation, 269270, 643

ago, 674, 683, 695, 737, 765

Ajax, 91, 545558

HTML fragments, 555557

JSON, 553555

JSONP, 557558

Unobtrusive JavaScript (UJS), 547550

alias_attribute, 626, 716717

alias_method_chain, 529, 717718

all_day, 765

all_month, 765

all_quarter, 765

all_week, 765

all_year, 765

allow_forgery_protection, 23

and_return, 593

anonymous?, 718

any?, 199

append, 656

arel_table, 165

around_create, 270

around_save, 270

Array, extensions, 651657

Array.wrap, 657

as: association_name, 215

as_json, 632633, 639, 659660, 682, 687, 697

assert

assert_difference, 761762

assert_equal, 584

assert_no_difference, 762

assert_no_match, 759

assert_not, 762

assert_not_empty, 760

assert_not_equal, 760

assert_not_in_delta, 760

assert_not_in_epsilon, 760

assert_not_includes, 760

assert_not_instance_of, 760

assert_not_kind_of, 760

assert_not_nil, 760

assert_not_operator, 760

assert_not_predicate, 760

assert_not_respond_to, 760

assert_not_same, 760

assert_nothing_raised, 760

assert_raise, 761

assert_valid_keys, 701702

asset_host, 26, 343345

Asset hosts, 343345

Asset Pipeline, 559574

file serving, 572573

fingerprinting, 571572

compression, 569, 573

Data URL, 571

helpers, 569570

built-in SASS asset path helpers, 570571

getting the URL of an asset file, 570

images, 570

manifest files, 561567

directives, 563564

format handlers, 565568

gemified assets, 564565

index files, 565

search path, 564

postprocessing, 568569

custom compressor, 569

JavaScripts, 568

stylesheets, 568

rake tasks, 573674

template engines, 566567

web server configuration, 572573

Assets, 2526

Assets debug mode, 22

assigns, 318

associate_with, 688

Asynchronous processing. See Background processing.

at, 749, 776

at_beginning_of_day, 674, 683, 765

at_beginning_of_hour, 683, 765

at_beginning_of_minute, 683, 765

at_beginning_of_month, 674675

at_beginning_of_quarter, 675, 766

at_beginning_of_week, 675, 766

at_beginning_of_year, 675, 766

at_end_of_day, 675, 683, 766

at_end_of_hour, 683, 766

at_end_of_minute, 683, 766

at_end_of_month, 675, 766

at_end_of_quarter, 675, 766

at_end_of_week, 675, 766

at_end_of_year, 675, 766

at_midnight, 674, 683, 765

Atom Feeds

autodetection, 338

atom feed method, 346347

atomic_write, 698699

attr_accessible, 481

attr_internal_accessor, 718719

attr_internal_reader, 718

attr_internal_writer, 719

attr_protected, 481

attr_readonly, 150

attribute_methods.rb, 626627

attribute_method_affix, 626

attribute_method_prefix, 626

attribute_method_suffix, 626

attributes, 141

attributes=, 141

audio_path, 341

audio_tag, 341

authenticate_user!, 462

Authentication

Active Resource, 467

client-side certificates, 490

HTTP basic, 467

HTTP digest, 468

auto_discovery_link_tag, 338339

autoclose, 446

autoload, 691

autoload_at, 692

autoload_module!, 689

autoload_once_paths, 687

autoload_paths, 687688

autoload_under, 692

autoloadable_module?, 689

autoloaded?, 689

autoloads, 692

average, 199, 278279

await, 673

B

background processing, 527543

backtrace_cleaner, 12, 657

base_path, 318

be_an_error, 530

be_routable, 604

before, 580581

before_action, 116

before_add, 215216

before_create, 270, 628629

before_destroy, 151, 216, 268270, 273274, 276

before_first_fork, 539

before_fork, 539

before_perform, 539

before_remove, 216

before_save, 272273, 666667

before_update, 270

before_validation, 269271

begin_db_transaction, 167

beginning_of_*

beginning_of_day, 674, 683, 765

beginning_of_hour, 683, 765

beginning_of_minute, 683, 765

beginning_of_month, 674675

beginning_of_quarter, 675, 766

beginning_of_week, 676, 767

belongs_to associations, 149, 180, 196, 205214

building and creating related objects, 206

options, 206211

polymorphic, 197

reloading, 205

scopes, 211214

touch, 210

benchmarking, 120, 213, 219, 221, 658659

Better Errors gem, 782783

binary data storage, 185

blank?, 633, 657, 698, 704, 729, 730, 739, 749, 778

breadcrumbs, 424425

build, 199200

build_association, 206

Builder::XmlMarkup class, 617, 620622

Bundler, 27

button_tag, 379

button_to, 418, 548549

by, 510

byte / bytes, 731

C

cache, 510

cache_classes=, 18

cache_directory, 507

cache_if, 516

cache_key, 513, 517, 525, 637, 660

cache_path, 520

cache_store=, 452453, 519520, 522

cache_sweeper, 518

cache_unless, 516

caches_action, 506, 508, 510

caches_page, 506507

Caching

:counter_cache, 195196

action caching, 508509

avoiding extra database activity during, 518519, 521522

CacheHelper module, 347

conditional caching, 516

controlling web caches and proxies, 523524

disabling in development mode, 20

ETags, 524526

expiration, 516518

fetch, 522523

fragment caching, 509516

logging, 519

new caches, 522

page caching, 506507

query caching, 145

storage, 519521

Store class, 592597

sweeping, 508, 517518

view caching, 505521

calculate, 200

Callbacks

Action Controller, 116121

Action Mailer, 499500

Active Model module, 627629

Active Record, 268278

has_many associations, 214

new in Rails 4, 499500

callbacks.rb, 628629

camelize, 707708, 752753

capitalize, 725

capture, 348, 713

CAS, 465

cattr_accessor, 670

cattr_reader, 671

cattr_writer, 671

CDATA, 393, 446447

change, 178, 584585, 676, 684, 767

change_default, 178179

change_table, 178, 197

changed, 630

changed_attributes, 631

changed?, 630

changes, 631

chars proxy, 756757

check_box, 367

check_box_tag, 379

Class

automatic reloading, 1820

extensions, 668671

Rails class loader, 1819

class << self, 297

class_attribute, 668670

class_eval, 297, 299, 714

classify, 753

cleanup, 661

clear, 200, 261, 661, 689, 708

clear_query_cache, 145

clone, 739

collection_check_boxes, 373374

collection_radio_buttons, 374375

collection_select, 372, 374

CollectionProxy, 239240

color_field, 367

color_field_tag, 379

column, 179

commit_db_transaction, 168

compact, 699

compact!, 699

compiler_class, 447

compose, 725

concat, 395

concern, 719720

Concern module, 671672

concerning, 719

Concurrency. See Database Locking

config, 673

config_accessor, 673

Configurable module, 673

configure, 673

consider_all_requests_local=, 20

console, 17

const_missing, 688, 690, 724

constant_watch_stack, 688

constantize, 689, 753

content_for, 315316, 348349

content_for?, 349

content_tag, 394

content_tag_for, 390391

context, 578

controller, 318319

Controllers. See Action Controller

Convention over configuration, 103, 129, 132, 171, 401

Cookies, 319, 455457

:secure option, 456

reading and writing, 455456

session store, 1415, 453455

signing, 456

copy_instance_variables_from, 718

count, 200, 279, 633

count_by_sql, 144

Country Select gem, 783

create, 199, 200201

create_association, 206

create_join_table, 178

create_table, 176178, 223

create!, 200201

created_at, 186

created_on, 186

CRUD (Create Read Update Delete), 138151

routing and, 6669

CSS

linking stylesheets to template, 340

relation to Haml, 446

sanitizing, 393

Currency

formatting, 385

Money gem, 301302

current

current_cycle, 396

current_page, 419

current_page?, 419

cycle, 396

D

dasherize, 12, 614, 654, 753

Data migration, 187189

Databases

configuring, 2627, 171

connecting to multiple, 165166

foreign-key constraints, 292

locking, 151155

considerations, 154155

optimistic, 152154

pessimistic, 154

migrations. See ActiveRecord, Migrations.

schemas, 1617, 152, 171172

seeding, 190191

using directly, 167169

Date, extensions, 673682

date_field, 367

date_field_tag, 380

DATE_FORMATS hash constant, 770

DateHelper module, 349356

Date input tags, 367, 380

date_select, 350

datetime

datetime_field, 367368

datetime_field_tag, 380

datetime_local_field, 368

datetime_local_field_tag, 380

datetime_select, 351, 416

DateTime, extensions, 682687

day / days, 737

days_ago, 677, 767

days_in_month, 767

days_since, 677, 767

days_to_week_start, 677, 767

Debugger gem, 783

Decent Exposure gem, 105, 317318

decimal precision, 184185

decode, 712

decompose, 725

decrement, 271, 662

decrypt_and_verify, 715

deep_merge, 700

deep_merge!, 700

deep_stringify_keys, 702

deep_symbolize_keys, 702

deep_transform_keys, 702

default_locale, 402

default_scope, 266

default_timezone=, 171

define_attribute_method, 627

define_attribute_methods, 627

define_callbacks, 665667

define_model_callbacks, 628629

delay, 534

delay_for, 534

delay_unti, 534

Delayed Job gem, 528530

delegate, 720721

delete, 168, 201, 271, 633, 662

delete_all, 199201, 271

delete_matched, 662

demodulize, 753

depend_on, 689

deprecate_methods, 693, 722

Deprecation, 21, 693694, 722, 745

Deprecation.behavior, 693

descendants, 694

describe, 578

destroy_all, 201

destroyed?, 151

Devise gem, 459466

direct_descendants, 694

disconnect!, 170

distance_of_time_in_words, 355356, 416

distance_of_time_in_words_to_now, 356

distinct, 222

div_for, 327328, 391

does_not_match?, 588

dom_id, 426

Domain-Specific Languages, 131, 298

downcase, 726

Draper gem, 783784

drop_table, 192

duplicable?, 739740

Duration class, 695696

E

each, 633

Eager load, 20

eager_autoload, 692

eager_load!, 692

element, 637

Email. See Action Mailer

email_field, 368

email_field_tag, 380

empty?, 201, 633

enable_warnings, 713

encode, 712

encode_json, 730, 749

encode64, 779

encrypt_and_sign, 715

end_of_*

end_of_day, 675, 683, 766

end_of_hour, 683, 766

end_of_minute, 683, 766

end_of_month, 675, 766

end_of_quarter, 675, 766

end_of_week, 677, 767

end_of_year, 675, 766

ends_with?, 757

enqueue, 529530, 532533

Enumerable, extensions, 696697

ERb, 313, 697698

asset pipeline, 566, 570

Devise, 463

email templates, 496497

Haml versus, 433434, 439, 463. See also Haml

rendering inline template code, 106

error_message_on, 332333

error_messages, 332334

error_messages_for, 333334

errors, 261, 642

escape_attrs, 447

escape_html, 447

escape_javascript, 385

escape_once, 394

establish_connection, 164166

ETags, 524525

exabyte / exabytes2, 731

except, 700701

except!, 701

exception_handler, 418

excerpt, 397

Excerpting text, 397

exclude?, 696, 750

execute, 168

exist?, 523, 662

exists?, 160

expect, 583584

expire

expire_action, 516517

expire_fragment, 516517

expire_page, 516517

expires_in, 520

expires_now, 524

explicitly_unloadable_constants, 688

extending, 160, 219

extract!, 703

extract_options!, 655

F

Facebook Open Graph meta tags, 316

fallbacks=, 25

favicon_link_tag, 339

favicon.ico file, 339

fetch, 522523, 662664

field_set_tag, 380

fields_for, 362365

fifth, 652

file_field, 368

file_field_tag, 380381

Files

extensions by Active Support, 698699

reporting sizes to users, 385389

upload field, 368, 380381

find

find_by_sql, 143144

find_tzinfo, 776

find_zone, 771

find_zone!, 772

Firebug, 546

first, 202, 749

flash, 320321

flash.now, 321

floats, 186, 659

flush, 759

font_path, 341

foreign_key, 208, 217, 754

form, 335336

form_for, 92, 358, 549

form_tag, 381382, 549

format, 447

formatted_offset, 685, 770, 776

Forms, 357371

accepts_nested_attributes_for method, 362363

automatic view creation, 335337

button_to helper method, 418, 548549

helper methods, 357371

input, 366371

fortnight / fortnights, 737

forty_two, 652

fourth, 652

fragment_exist?, 518519

freeze, 763

fresh_when, 525

Friends gem, 786788

from, 159160, 651, 749

from_json, 639

from_now, 695, 738

from_xml, 622624, 640, 699700

full_messages, 633

full_messages_for, 633

future?, 677678, 684, 767

G

Gemfile, 38

dependencies, 8

essential, 782789

installing, 57

loading, 45

locking, 7

packaging 79

generate, 716

generate_key, 665, 714

generate_message, 633634

generated_attribute_method, 627

Geocoding, 272273

gigabyte / gigabytes, 731

grapheme_length, 726

group, 160161, 219

grouped_collection_select, 372

Gzip, 705

H

Haml, 433448

attributes, 434436

boolean, 436

clases and IDs, 436438

data, 435436

empty tags, 439

implicit divs, 438439

comments, 440441

configuration, 446448

content, 445446

creating elements, 434

doctype, 440

escaping, 442443, 447

filters, 444445

helpers, 443444

HTML and, 440441, 442, 447

interpolation, 442

multiline declarations, 443

handle_asynchronously, 529

has_and_belongs_to_many associations, 222226

bidirectional, 224225

custom SQL, 211213

extra columns, 225

real join models and habtm, 225226

self-referential, 223224

has_key?, 634

has_many associations, 214222

:conditions option, 251

:include option, 213

callbacks, 214

has_many :through associations, 226230

aggregating, 228229

join models, 226227, 229230

options, 230233

usage, 228

validations and, 229230

has_one associations, 233236

:as, 235

:class name option, 235

:dependent, 235

options, 235

scopes, 236

together with has_many, 235

has_secure_password, 466467

Hash, extensions, 699704

Hash.from_trusted_xml, 699

Hash.from_xml, 699700

HashWithIndifferentAccess class, 705

having, 161, 219

Helper methods

breadcrumbs helper, 424425

helper specs, 605

photo_for helper, 423424

Title helper, 422423

writing your own View helpers, 422425

helper_method, 91, 468

hidden_field, 368

hidden_field_tag, 382

hide_action, 116

highlight, 397

history, 688

hook!, 689

hour / hours, 738

hstore data type, 304305

HTML

escaping, 442, 447, 485486, 697698

sanitizing, 487

tags

a, 419421

audio, 341

empty, 439

form. See Forms.

image, 341342

label, 368369

option, 378379

password, 383

script, 385

select, 383

submit, 383384

video, 342

html_escape, 697698

html_escape_once(s), 698

html_safe, 757

HTTP

foundation of REST, 6264

role in routing, 38, 41, 54

stateless, 449

status codes, 109111

verbs (GET, POST, etc.), 6871, 74, 419, 549

human, 637, 708

human_attribute_name, 413414, 417, 641

human_name, 419

humanize, 754

hyphenate_data_attrs, 447

I

i18n_key, 637

i18n_scope, 641

ids, 202, 279

Image tags, 341342

image_path, 341342

image_submit_tag, 382

image_tag, 341342

in, 679, 684, 696, 769

in?, 740

in_groups, 655

in_groups_of, 656

in_milliseconds, 738

in_time_zone, 682, 686, 758, 772

include, 202, 634, 740, 746747

included, 295296

includes, 161162, 219220

increment, 271, 664

increment_counter, 271

indent, 752

indent!, 752

index, 179

index_by, 696

inflections, 709

inherited, 694

initialize, 665, 714716, 776

Initializers, 1115

backtrace silencers.rb, 1213

file parameter logging, 12

inflections.rb, 1213, 705

mime_types.rb, 1314

session store.rb, 1415, 455

wrap parameters, 15

input, 336337

inquiry, 756

insert, 168

insert_after, 98

insert_before, 98

inspect, 695696

instance_eval, 118, 255, 269

instance_values, 740

instance_variable_names, 740741

instrument, 729730

Integer, extensions, 711712

Internationalization (I18n), 399418

default locale, 11

exception handling, 417418

i18n_key, 637

i18n_scope, 641

interpolation, 442

locale files, 409410

methods, 400401, 416417

setting user locales, 405406

setup, 401402

storing custom translations, 413316

invalid?, 642

inverse_of, 208, 217218

irregular, 709

is_utf8?, 757

it, 581

J

JavaScript

Ajax and, 557558

escaping, 385

helpers, 339340, 385

postprocessing, 658

Unobtrusive JavaScript (UJS), 547550

javascript_include_tag, 339340, 559, 569

javascript_path, 340

javascript_tag, 385

joins, 162

jQuery framework, 547, 550, 552, 557558. See also Turbolinks

JSON, 64, 87, 712

:json, 107

Ajax and, 553555

as_json, 632633

format segments, 4647

output escaping, 487, 698

PostgreSQL column type, 310311

Redis database, 532

serializers, 639

strings, 659660, 682, 687, 749, 763

variants, 126

wrap parameters, 15

json_escape, 698

JSONP, 107, 557558

K

Kernel, extensions, 712715

Kaminari gem, 784785

keys, 634

kilobyte / kilobytes, 731

kind, 649

L

l, 401

label, 368369

label_tag, 382

last, 202, 750

last_month / prev_month, 678, 768

last_quarter / prev_quarter, 678, 768

last_week, 678, 768

last_year / prev_year, 678, 768

LDAP, 465

length, 202

let, 578580

let!, 580

limit, 158159, 221, 726

link_to, 419420, 549550

link_to helper methods, 549550

link_to_if, 420

link_to_unless, 420

link_to_unless_current, 420421

list_of, 444

load, 742

load?, 689

load_file, 690

load_missing_constant, 690

load_once_path?, 690

loadable_constants_for_path, 690

loaded, 688

local, 776

local_assigns, 326327

local_constants, 722

local_to_utc, 776

Locale files, 409410

localize, 401, 407

lock!, 154

log_activity, 688

log_level, 16

logger, 321

Logging, 2935

backtrace silencing, 1213, 657658

colorization, 34

level override, 16

levels, 2930

log file analysis, 3235

Logger, extensions, 714715

Syslog, 35

tagged, 32

lookup_ancestors, 641

lookup_store, 522

M

mail_to, 421

many?, 199, 696697

mark_for_destruction, 237238

mark_for_unload, 690

match, 4043

matches?, 5960, 588589

mattr_accessor, 719

mattr_reader, 719

mattr_writer, 719

maximum, 203, 279

mb_chars, 724727, 756757

mechanism, 688

megabyte / megabytes, 731

Memcached, session store, 452453

MessageEncryptor class, 715

MessageVerifier class, 715716

method_missing, 726

middle_of_day / noon, 678, 684, 768

Middleware (Rack), 9698

midnight, 683, 674, 683, 765

MIME types, 1314

mime_type, 447

minimum, 203, 279

minute / minutes, 738

mock, 520

mock_model, 605

mock_with, 598

model_name, 638

Module, extensions, 716724

monday, 678, 768

MongoDB, 463, 528, 530

month / months, 738

month_field, 369

month_field_tag, 382

months_ago, 678, 768

months_since, 678, 768

ms, 658

multiline?, 747

multiple_of?, 712

mute, 664

MVC (Model-View-Controller), 2, 15, 37, 95, 106, 311

N

name_path, 5455

name_url, 5455

Named scopes. See Active Record, scopes

namespace, 59

Nested Form Fields gem, 785786

new, 91, 203

new_constants_in, 690

new_record?, 138, 202, 236

next_*

next_month, 678, 768

next_quarter, 678, 768

next_week, 679, 768

next_year, 679, 769

Nonces, 454

none, 162

normalize, 726, 728

Notifications, 729

now, 777

nsec, 685

number_field, 369

number_field_tag, 382383

number_to_currency, 385386, 417

number_to_human_size, 386388

number_to_percentage, 388

number_to_phone, 388389

number_with_delimiter, 389, 417

number_with_precision, 389390, 417

Numbers

conversions, 385390

delimiters, 386390, 731736

extensions to Numeric class, 738743

O

Object, extensions, 738743

object_id, 205

offset, 158159, 222

OpenSSL Digests, 665, 714715

option_groups_from_collection_for_select, 372, 375376

options, 664

options_for_select, 376378

options_from_collection_for_select, 378

order, 222, 236

ordinal, 711712

ordinalize, 712

overlaps?, 747

P

page_class, 444

param_key, 637

parameterize, 56, 710, 754

params, 322

params hash, 322

parent, 722

parent_name, 722

parents, 722723

parse, 777

parser_class, 447

partial_counter, 328329

Partials, 105106, 322329

passing variables to, 325327

rendering collections, 327328

rendering objects, 327

reuse, 324

shared, 324325

wrapping and generalizing, 425426

password_field, 370

password_field_tag, 383

past?, 679, 684

pending, 582583

perform_caching=, 20, 22, 24, 509

period_for_local, 777

period_for_utf, 777

persisted?, 138, 302303, 335, 629

petabyte / petabytes, 731

photo_for, 423424

pluck, 203, 279

Plugins, xlvii, 345346, 540

plural, 637, 706

Pluralization

i18n, 399418

Inflections class, 705711

Inflector class, 12

pluralize, 398, 754

pluralize_table_names=, 133

prepend, 657

prepend_after_filter, 118119

prepend_before_filter, 118119

presence, 739

present?, 739

preserve, 448

previous_changes, 631

primary_key, 210, 218

primary_key_prefix_type=, 133

Prototype framework, 547

provide, 349

proxy_owner, 240

proxy_reflection, 240

proxy_target, 240

Pry gems, 786788

published_prior_to, 240

Pundit, 469476

creating a policy, 471472

controller integration, 472

policy scopes, 473474

strong parameters, 474475

testing policies, 475476

Q

qualified_const_defined?, 690, 723

qualified_const_get, 723

qualified_const_set, 723

qualified_name_for, 691

quietly, 713

R

Rack, 9698, 9091

Rack::Sendfile middleware, 124

RACK_ENV variable, 1

routes as Rack endpoints, 48

radio_button, 370

radio_button_tag, 383

Railcasts, 790

Rails

class loader and reloading, 17, 615619

configurations, 135

development of, xl, xliiixliv

environments, 135, 781782

essentials, 781790

lib directory, 20

root directory, 4

runner, 541543

scaffolding, 147, 174, 333, 434

screencasts, 789790

settings, 918

application.rb file, 911

autoload_paths, 16, 687, 689690, 692

boot.rb file, 9

cherry-picking frameworks used, 10

custom environments, 23

development mode, 1820

environment.rb file, 9, 502, 557, 599

generator defaults, 11

initializers. See Initializers

production mode, 2326

test mode, 2223

Rails Admin gem, 787788

RAILS_ENV variable, 1

Railtie, 745746

raise_delivery_errors=, 21, 25

raise_error, 584585

Rake tasks

asset pipeline and, 573574

database-related, 171, 191194

listing routes, 53

Rack filters, 9697

Rails log files, 30

Resque, 540541

Rspec Rails gem, 596

Spring application preloader, 17

Random ordering (of records), 157158

Range, extensions, 746747

range_field, 370

range_field_tag, 383

raw, 390

raw_connection, 170

reachable?, 723724

read, 664

read_attribute, 135141

read_multi, 523524, 664665

readable_inspect, 681. 685

readonly, 163, 213, 222, 236

readonly_attributes, 150

reconnect!, 170

record_timestamps=, 187

RecordNotFound exception, 139

redefine_method, 724

redirect_to, 54

reference / references, 163, 180, 691

Regexp, extensions, 747

register, 14

register_alias, 14

register_javascript_expansion, 345346

register_stylesheet_expansion, 345346

release, 673

reload, 240

reload!, 102, 130

remove, 180181, 751

remove_belongs_to, 180181

remove_column, 187189

remove_constant, 691

remove_filters, 658

remove_index, 180

remove_possible_method, 724

remove_references, 180181

remove_silencers!, 12, 658

remove_timestamps, 181

remove_unloadable_constants!, 691

remove_whitespace, 448

remove!, 751

rename, 181

Rendering views, 102111

another actions’s template, 93, 102104

explicit, 103, 104

implicit, 102103

inline templates, 106

JSON, 107

nothing, 108

options, 108111

partials, see Partials.

render_views method, 603

text, 106

XML, 107

reorder, 163164

reorder_characters, 728

replace, 203

reply_to, 495, 502

Request handling

in routing, 99

redirecting, 111115

request, 322

require, 18, 742

require_dependency, 742

require_or_load, 689, 691, 742

Rescuable module, 748

rescue_from, 748

reset, 240

reset_callbacks, 668

reset_counters, 208

reset_cycle, 398

reset_sequence!, 168

respond_to, 322

Resque gem, 537541

REST and RESTful design, 6393

action set, 8892

collection routes, 8182

controller-only resources, 8386

forms, 359

HTTP verbs, 6869

member routes, 8081

nested resources, 7478

resources and representations, 6465

routes, 37, 6669

singular resource routes, 73

standard controller actions, 6164

reverse, 726

reverse_merge, 703

reverse_merge!, 703

reverse_order, 164

reverse_update, 703

reversible, 175

revert, 181

rollback_db_transation, 168

route_key, 638

route_to, 604

Routing, 3761

:id field, 44

concerns, 7879

constraining by request method, 41

formats, 4648

globbing, 5152

listing, 6061

match method, 4043

name_path versus name_url, 5455

named, 5257, 6768

rack endpoints, 48

redirecting, 4546

RESTful routes, 6669

:format parameter, 86

collection, 7982

controller mappings, 75

member, 8181

nested, 7478

singular and plural, 7173

root routes, 5051

routes.rb file, 3940

scopes, 5760

segment keys, 4344, 4950

RPX authentication, 465

RSpec, 575610

custom expectation matchers, 588591

fluent chaining, 590591

generator settings, 11

grouping related examples, 578

let methods, 578580

mocking and stubbing, 592595

pending, 582583

predicate matchers, 587591

running specs, 595596

shared behaviors, 591

shared context, 592

spec_helper.rb file, 596597, 607608

subjects, 586587

testing email, 502503

tools, 609610

RSS autodetection, 338339

Ruby

$LOAD PATH, 19

hashes, 375, 386, 450, 456, 657

macro-style methods, 131133

Marshal API, 450

modules for reusing common behavior, 292296

Ruby Toolbox, 789

RubyGems, xlvii

Bundler, 29

dependencies, 8

Git repository, loading directly from, 45

installing, 57

packaging, 79

S

safe_constantize, 691, 754

safe_join, 390

sanitize, 393

sanitize_css, 393

save, 147

save!, 147, 271

schema_format, 16, 171

scope, 57

Scopes. See Active Record, scopes

search_field, 370

search_field_tag, 383

search_for_file, 691

second / seconds, 652, 738

seconds_since_midnight, 684, 769

seconds_to_utc_offset, 777

seconds_until_end_of_day, 684, 769

secret_key_base, 27

Security

cross-site request forgery (XSRF), 360, 487490

cross-site scripting (XSS), 483484

fixation attacks, 490491

HTML, 485487

log masking, 479480

model mass-assignment attributes protection, 481483

password management, 477479

replay attacks, 454455

secrets, 491492

secure sockets layer. See SSL

SQL injection, 143144

token handling, 489490

select, 159, 203204, 213, 222, 372

select_all, 168

select_date, 351352

select_datetime, 352353

select_day, 352

select_hour, 352

select_minute, 352353

select_month, 353354, 416

select_one, 168169

select_second, 353354

select_tag, 383

select_time, 354

select_value, 169

select_values, 169

select_year, 354

send_data, 123124

send_file, 124126

serializable_hash, 639

serve_static_assets=, 22

Session Management, 449456

cleaning old sessions, 450, 452, 455

RESTful storage considerations, 85

turning off sessions, 451

session, 322

set, 634

set_callback, 668

Settings, 918

should, 583584

should_not, 583584

show_exceptions=, 22

Sidekiq, 531537

delayed Action Mailer, 533534

error handling, 536

monitoring, 536537

running, 534536

scheduled jobs, 533

workers, 523533

silence, 665, 715

silence!, 665

silence_stream, 713

silence_warnings, 713

simple_format, 398

Simple Form gem, 788

since, 679, 684, 696, 769

singleton_class, 714

singular, 638, 709

singular_route_key, 638

singularize, 755

site=, 204

size, 204, 634

skip_callback, 668

slice, 703704

slice!, 704, 726

smtp_settings, 502

SOAP, 64

specify, 581582

Specjour, 610

split, 656, 727

Spring application preloader, 1718

squish, 751

SSL

certificates for asset hosts, 345

OpenSSL digests, 665, 714715

serving protected assets, 345

stale?, 525526

starts_with?, 757

State Machine gem, 788789

Static content, 51, 400, 506

store_full_sti_class=, 171

store_translations, 412, 711

Streaming, 121126

String

extensions, 748758

usage versus symbols, 141

stringify_keys, 702

StringInquirer class, 758

strip_heredoc, 757

strip_links, 393

strip_tags, 393

stylesheet_link_tag, 340

stylesheet_path, 340

subclasses, 671

submit, 370

submit_tag, 383384

submit_to_remote, 361

sum, 204, 279, 697, 747

sunday, 679, 769

superclass_delegating_accessors, 671

supports_count_distinct?, 170

supports_migrations?, 170

suppress, 714

swapcase, 727

Symbol

extensions, 759

usage versus strings, 141

T

t, 401

table_name_prefix=, 133

table_name_suffix=, 133

tableize, 755

tables, 171

tag, 394395

tagged, 759

telephone_field, 370

telephone_field_tag, 384

template_engine, 11

Templates. See View templates

terabyte / terabytes, 731

test_framework, 11

text_area, 370371

text_area_tag, 384

text_field, 371

text_field_tag, 384

third, 652

thread_variable?, 763

thread_variable_get, 763

thread_variable_set, 763

thread_variables, 763

tidy_bytes, 727728

Time

extensions, 763773

input tags, 350351

reporting distances in time, 355356

storing in database, 185

Time Zones

DateTime conversions, 681682

default, 10

option tags helper, 375379

TimeZone class, 774778

TimeWithZone class, 773774

time

time_field, 371

time_field_tag, 384

time_select, 351

time_tag, 356

time_zone_options_for_select, 373, 378379

time_zone_select, 373

timestamps, 181

titleize, 755

to, 652, 720

to_a, 634

to_constant_name, 691

to_date, 367, 685, 750

to_datetime, 685, 750

to_default_s, 653

to_f, 685

to_formatted_s, 652653, 659, 681, 686, 731732, 746, 770771

to_h, 758

to_hash, 634

to_i, 686

to_json, 87, 107, 553, 741

to_key, 629

to_model, 629

to_options, 702

to_param, 629, 657, 704, 741

to_partial_path, 629

to_query, 704, 741

to_s, 653, 659, 771, 777

to_sentence, 653

to_sql, 265266

to_time, 681, 750

to_xml method, 611620

to_yaml, 779

today, 679, 769, 777

toggle, 271

toggle!, 271

tomorrow, 680, 769

touch, 210

transform_keys, 703

translate, 401, 407408, 410412

transliterate, 710711

travel, 762

travel_to, 762

truncate, 398399, 751

Truncating text, 398399

try, 741742

Turbolinks, 551553

U

ugly, 448

uncountable, 709710

undefine_attribute_method, 627

underscore, 755

unhook!, 691

Unicode

methods for handling, 727729

multibiyte safe proxy for, 756

pluralization rules, 412413

security concerns of, 392

uniq, 164, 204

unloadable, 743

Unobtrusive JavaScript (UJS), 547550

helpers, 548

jQuery UJS custom events, 550

unscope, 164165

until, 696, 737

update, 169, 271

update_all, 147, 188, 271

update_attribute, 148149, 260261

update_column(s), 260261, 271

update_counters, 271

updated_at, 186

updated_on, 186

URL

generation, 43

patterns in routing, 42

segment keys, 4344

url_field, 371

url_field_tag, 384385

url_for, 113, 358

us_utf8?, 757

us_zones, 379, 778

use_zone, 772

usec, 686

utc, 684

utc?, 684

utc_offset, 684, 778

utc_to_local, 778

utf8_enforcer_tag, 384385

V

valid?, 146, 241242, 256, 635, 643

validate, 210211, 218, 260, 649

validate!, 648

validates, 647648

validates_absence_of, 242, 643

validates_acceptance_of, 242243, 643

validates_associated, 243244

validates_callbacks, 643644

validates_confirmation_of, 244, 644

validates_each, 244245, 643

validates_exclusion_of, 246, 644

validates_format_of, 245246, 645646

validates_inclusion_of, 246, 645

validates_length_of, 246247, 645646

validates_numericality_of, 247248, 646647

validates_presence_of, 248249, 647

validates_uniqueness_of, 249251

validates_with, 251252, 648

Validation. See Active Record, validations

validators, 648

validators_on, 648

Value objects, 299302

View templates

capturing block content, 395

concat method, 395s

cycling content, 398

encapsulating logic in helper methods, 423424

highlighting content, 396

localization, 399

transforming text into HTML, 398

translation. See Internationalization.

word wrap, 399

See also Action View, 313329

values, 635

verify, 489, 716

verify!, 171

video_path, 342

video_tag, 342343

W

warn, 30, 693

warnings_on_first_load, 688

Web 2.0, 355, 431, 558

Web architecture, 6364

week / weeks, 738

week_field, 371

week_field_tag, 385

weeks_ago, 680, 769

weeks_since, 680, 769

where, 211212, 218219, 236

will_unload?, 691

with_indifferent_access, 701, 705

with_options, 255, 742

word_wrap, 399

write, 661, 665

write_attribute, 135, 140

X

XML, 611625

Active Record associations, 614617

customizing output, 613614

extra elements, 618

overriding, 620

parsing, 622624

Ruby hashes, 616

to_xml method, 611620

typecasting, 624

XML Builder, 620622

XMLHttpRequestObject, 545546

XMLMini module, 778780

x_sendfile_header=, 24, 573

Y

y, 101

YAML, 26, 136

Devise, 460

Resque, 537538

Sidekiq, 535

translations, 402, 408, 413

year / years, 738

years_ago, 680, 769

years_since, 680, 769

yesterday, 680, 770

yield, 119120, 315316

Z

zone, 772

zone=, 772773

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.82.253