0% found this document useful (0 votes)
14 views53 pages

65416

The document is a download link for the 'Ruby on Rails Tutorial: Learn Web Development with Rails, 3rd Edition' by Michael Hartl, which includes comprehensive content on developing web applications using Ruby on Rails. It provides an overview of the book's structure, including chapters on setting up a development environment, creating applications, and deploying them. Additionally, it lists other recommended Ruby on Rails resources and books available for download.

Uploaded by

dorsushurjo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views53 pages

65416

The document is a download link for the 'Ruby on Rails Tutorial: Learn Web Development with Rails, 3rd Edition' by Michael Hartl, which includes comprehensive content on developing web applications using Ruby on Rails. It provides an overview of the book's structure, including chapters on setting up a development environment, creating applications, and deploying them. Additionally, it lists other recommended Ruby on Rails resources and books available for download.

Uploaded by

dorsushurjo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Ruby on Rails Tutorial Learn Web Development

with Rails 3rd Edition Michael Hartl download

https://ebookultra.com/download/ruby-on-rails-tutorial-learn-web-
development-with-rails-3rd-edition-michael-hartl/

Explore and download more ebooks or textbooks


at ebookultra.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Agile Web Development with Rails 5 1st Edition Sam Ruby

https://ebookultra.com/download/agile-web-development-with-
rails-5-1st-edition-sam-ruby/

RailsSpace Building a Social Networking Website with Ruby


on Rails Addison Wesley Professional Ruby Series Hartl

https://ebookultra.com/download/railsspace-building-a-social-
networking-website-with-ruby-on-rails-addison-wesley-professional-
ruby-series-hartl/

Agile Web Development with Rails 4th edition Beta 10


version Sam Ruby

https://ebookultra.com/download/agile-web-development-with-rails-4th-
edition-beta-10-version-sam-ruby/

Practical JRuby on Rails Web 2 0 projects bringing Ruby on


Rails to the Java platform 1st Edition Ola Bini

https://ebookultra.com/download/practical-jruby-on-rails-
web-2-0-projects-bringing-ruby-on-rails-to-the-java-platform-1st-
edition-ola-bini/
Build Your Own Ruby on Rails Web Applications 1st Edition
Patrick Lenz

https://ebookultra.com/download/build-your-own-ruby-on-rails-web-
applications-1st-edition-patrick-lenz/

Ruby on Rails For Dummies 1st Edition Burd

https://ebookultra.com/download/ruby-on-rails-for-dummies-1st-edition-
burd/

Ruby on Rails Background Jobs with Sidekiq 1 / converted


Edition David B. Copeland

https://ebookultra.com/download/ruby-on-rails-background-jobs-with-
sidekiq-1-converted-edition-david-b-copeland/

Practical Reporting with Ruby and Rails 1st Edition David


Berube

https://ebookultra.com/download/practical-reporting-with-ruby-and-
rails-1st-edition-david-berube/

Pro Active Record Databases with Ruby and Rails 1st


Edition Kevin Marshall

https://ebookultra.com/download/pro-active-record-databases-with-ruby-
and-rails-1st-edition-kevin-marshall/
Ruby on Rails Tutorial Learn Web Development with
Rails 3rd Edition Michael Hartl Digital Instant Download
Author(s): Michael Hartl
ISBN(s): 9780134077703, 0134077709
Edition: 3
File Details: PDF, 15.25 MB
Year: 2015
Language: english
COVERSRAI
LS4.
2

THE
RUBYON RAI
LS
TUTORI
AL
LEARN WEBDEVELOPMENTWI
TH RAI
LS
THI
RD EDI
TION

BOOKAND SCREENCASTSBY
MI
CHAELHARTL
2
Ruby on Rails Tutorial
Learn Web Development with Rails

Michael Hartl
ii
Contents

1 From zero to deploy 1


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Conventions in this book . . . . . . . . . . . . . . . . 7
1.2 Up and running . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.1 Development environment . . . . . . . . . . . . . . . 10
1.2.2 Installing Rails . . . . . . . . . . . . . . . . . . . . . 12
1.3 The first application . . . . . . . . . . . . . . . . . . . . . . . 15
1.3.1 Bundler . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.3.2 rails server . . . . . . . . . . . . . . . . . . . . 24
1.3.3 Model-View-Controller (MVC) . . . . . . . . . . . . 25
1.3.4 Hello, world! . . . . . . . . . . . . . . . . . . . . . . 31
1.4 Version control with Git . . . . . . . . . . . . . . . . . . . . . 34
1.4.1 Installation and setup . . . . . . . . . . . . . . . . . . 36
1.4.2 What good does Git do you? . . . . . . . . . . . . . . 39
1.4.3 Bitbucket . . . . . . . . . . . . . . . . . . . . . . . . 40
1.4.4 Branch, edit, commit, merge . . . . . . . . . . . . . . 44
1.5 Deploying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.5.1 Heroku setup . . . . . . . . . . . . . . . . . . . . . . 51
1.5.2 Heroku deployment, step one . . . . . . . . . . . . . 54
1.5.3 Heroku deployment, step two . . . . . . . . . . . . . 54
1.5.4 Heroku commands . . . . . . . . . . . . . . . . . . . 54
1.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
1.6.1 What we learned in this chapter . . . . . . . . . . . . 57

iii
iv CONTENTS

1.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

2 A toy app 61
2.1 Planning the application . . . . . . . . . . . . . . . . . . . . 62
2.1.1 A toy model for users . . . . . . . . . . . . . . . . . . 65
2.1.2 A toy model for microposts . . . . . . . . . . . . . . 65
2.2 The Users resource . . . . . . . . . . . . . . . . . . . . . . . 66
2.2.1 A user tour . . . . . . . . . . . . . . . . . . . . . . . 69
2.2.2 MVC in action . . . . . . . . . . . . . . . . . . . . . 76
2.2.3 Weaknesses of this Users resource . . . . . . . . . . . 84
2.3 The Microposts resource . . . . . . . . . . . . . . . . . . . . 84
2.3.1 A micropost microtour . . . . . . . . . . . . . . . . . 85
2.3.2 Putting the micro in microposts . . . . . . . . . . . . 90
2.3.3 A user has_many microposts . . . . . . . . . . . . . 90
2.3.4 Inheritance hierarchies . . . . . . . . . . . . . . . . . 93
2.3.5 Deploying the toy app . . . . . . . . . . . . . . . . . 96
2.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
2.4.1 What we learned in this chapter . . . . . . . . . . . . 99
2.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

3 Mostly static pages 103


3.1 Sample app setup . . . . . . . . . . . . . . . . . . . . . . . . 104
3.2 Static pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.2.1 Generated static pages . . . . . . . . . . . . . . . . . 108
3.2.2 Custom static pages . . . . . . . . . . . . . . . . . . 118
3.3 Getting started with testing . . . . . . . . . . . . . . . . . . . 121
3.3.1 Our first test . . . . . . . . . . . . . . . . . . . . . . 123
3.3.2 Red . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
3.3.3 Green . . . . . . . . . . . . . . . . . . . . . . . . . . 126
3.3.4 Refactor . . . . . . . . . . . . . . . . . . . . . . . . . 130
3.4 Slightly dynamic pages . . . . . . . . . . . . . . . . . . . . . 130
3.4.1 Testing titles (Red) . . . . . . . . . . . . . . . . . . . 131
3.4.2 Adding page titles (Green) . . . . . . . . . . . . . . . 133
3.4.3 Layouts and embedded Ruby (Refactor) . . . . . . . . 136
CONTENTS v

3.4.4 Setting the root route . . . . . . . . . . . . . . . . . . 142


3.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
3.5.1 What we learned in this chapter . . . . . . . . . . . . 145
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
3.7 Advanced testing setup . . . . . . . . . . . . . . . . . . . . . 148
3.7.1 MiniTest reporters . . . . . . . . . . . . . . . . . . . 149
3.7.2 Backtrace silencer . . . . . . . . . . . . . . . . . . . 150
3.7.3 Automated tests with Guard . . . . . . . . . . . . . . 150

4 Rails-flavored Ruby 159


4.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.2 Strings and methods . . . . . . . . . . . . . . . . . . . . . . . 164
4.2.1 Comments . . . . . . . . . . . . . . . . . . . . . . . 165
4.2.2 Strings . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.2.3 Objects and message passing . . . . . . . . . . . . . . 169
4.2.4 Method definitions . . . . . . . . . . . . . . . . . . . 172
4.2.5 Back to the title helper . . . . . . . . . . . . . . . . . 174
4.3 Other data structures . . . . . . . . . . . . . . . . . . . . . . 175
4.3.1 Arrays and ranges . . . . . . . . . . . . . . . . . . . 175
4.3.2 Blocks . . . . . . . . . . . . . . . . . . . . . . . . . 179
4.3.3 Hashes and symbols . . . . . . . . . . . . . . . . . . 182
4.3.4 CSS revisited . . . . . . . . . . . . . . . . . . . . . . 187
4.4 Ruby classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
4.4.1 Constructors . . . . . . . . . . . . . . . . . . . . . . 189
4.4.2 Class inheritance . . . . . . . . . . . . . . . . . . . . 191
4.4.3 Modifying built-in classes . . . . . . . . . . . . . . . 195
4.4.4 A controller class . . . . . . . . . . . . . . . . . . . . 196
4.4.5 A user class . . . . . . . . . . . . . . . . . . . . . . . 197
4.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.5.1 What we learned in this chapter . . . . . . . . . . . . 202
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

5 Filling in the layout 205


5.1 Adding some structure . . . . . . . . . . . . . . . . . . . . . 206
vi CONTENTS

5.1.1 Site navigation . . . . . . . . . . . . . . . . . . . . . 206


5.1.2 Bootstrap and custom CSS . . . . . . . . . . . . . . . 215
5.1.3 Partials . . . . . . . . . . . . . . . . . . . . . . . . . 222
5.2 Sass and the asset pipeline . . . . . . . . . . . . . . . . . . . 227
5.2.1 The asset pipeline . . . . . . . . . . . . . . . . . . . . 229
5.2.2 Syntactically awesome stylesheets . . . . . . . . . . . 232
5.3 Layout links . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.3.1 Contact page . . . . . . . . . . . . . . . . . . . . . . 240
5.3.2 Rails routes . . . . . . . . . . . . . . . . . . . . . . . 242
5.3.3 Using named routes . . . . . . . . . . . . . . . . . . . 244
5.3.4 Layout link tests . . . . . . . . . . . . . . . . . . . . 247
5.4 User signup: A first step . . . . . . . . . . . . . . . . . . . . 250
5.4.1 Users controller . . . . . . . . . . . . . . . . . . . . . 250
5.4.2 Signup URL . . . . . . . . . . . . . . . . . . . . . . 251
5.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.5.1 What we learned in this chapter . . . . . . . . . . . . 254
5.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

6 Modeling users 259


6.1 User model . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.1.1 Database migrations . . . . . . . . . . . . . . . . . . 262
6.1.2 The model file . . . . . . . . . . . . . . . . . . . . . 269
6.1.3 Creating user objects . . . . . . . . . . . . . . . . . . 269
6.1.4 Finding user objects . . . . . . . . . . . . . . . . . . 273
6.1.5 Updating user objects . . . . . . . . . . . . . . . . . . 275
6.2 User validations . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.2.1 A validity test . . . . . . . . . . . . . . . . . . . . . . 277
6.2.2 Validating presence . . . . . . . . . . . . . . . . . . . 278
6.2.3 Length validation . . . . . . . . . . . . . . . . . . . . 282
6.2.4 Format validation . . . . . . . . . . . . . . . . . . . . 284
6.2.5 Uniqueness validation . . . . . . . . . . . . . . . . . 290
6.3 Adding a secure password . . . . . . . . . . . . . . . . . . . 298
6.3.1 A hashed password . . . . . . . . . . . . . . . . . . . 298
6.3.2 User has secure password . . . . . . . . . . . . . . . 301
CONTENTS vii

6.3.3 Minimum password length . . . . . . . . . . . . . . . 303


6.3.4 Creating and authenticating a user . . . . . . . . . . . 304
6.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
6.4.1 What we learned in this chapter . . . . . . . . . . . . 309
6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7 Sign up 313
7.1 Showing users . . . . . . . . . . . . . . . . . . . . . . . . . . 313
7.1.1 Debug and Rails environments . . . . . . . . . . . . . 314
7.1.2 A Users resource . . . . . . . . . . . . . . . . . . . . 320
7.1.3 Debugger . . . . . . . . . . . . . . . . . . . . . . . . 326
7.1.4 A Gravatar image and a sidebar . . . . . . . . . . . . 329
7.2 Signup form . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
7.2.1 Using form_for . . . . . . . . . . . . . . . . . . . 338
7.2.2 Signup form HTML . . . . . . . . . . . . . . . . . . 341
7.3 Unsuccessful signups . . . . . . . . . . . . . . . . . . . . . . 345
7.3.1 A working form . . . . . . . . . . . . . . . . . . . . . 345
7.3.2 Strong parameters . . . . . . . . . . . . . . . . . . . 351
7.3.3 Signup error messages . . . . . . . . . . . . . . . . . 353
7.3.4 A test for invalid submission . . . . . . . . . . . . . . 359
7.4 Successful signups . . . . . . . . . . . . . . . . . . . . . . . 362
7.4.1 The finished signup form . . . . . . . . . . . . . . . . 362
7.4.2 The flash . . . . . . . . . . . . . . . . . . . . . . . . 366
7.4.3 The first signup . . . . . . . . . . . . . . . . . . . . . 369
7.4.4 A test for valid submission . . . . . . . . . . . . . . . 372
7.5 Professional-grade deployment . . . . . . . . . . . . . . . . . 373
7.5.1 SSL in production . . . . . . . . . . . . . . . . . . . 374
7.5.2 Production webserver . . . . . . . . . . . . . . . . . . 375
7.5.3 Ruby version number . . . . . . . . . . . . . . . . . . 377
7.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
7.6.1 What we learned in this chapter . . . . . . . . . . . . 379
7.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
viii CONTENTS

8 Log in, log out 385


8.1 Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
8.1.1 Sessions controller . . . . . . . . . . . . . . . . . . . 387
8.1.2 Login form . . . . . . . . . . . . . . . . . . . . . . . 389
8.1.3 Finding and authenticating a user . . . . . . . . . . . 394
8.1.4 Rendering with a flash message . . . . . . . . . . . . 398
8.1.5 A flash test . . . . . . . . . . . . . . . . . . . . . . . 401
8.2 Logging in . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
8.2.1 The log_in method . . . . . . . . . . . . . . . . . . 404
8.2.2 Current user . . . . . . . . . . . . . . . . . . . . . . . 406
8.2.3 Changing the layout links . . . . . . . . . . . . . . . 411
8.2.4 Testing layout changes . . . . . . . . . . . . . . . . . 417
8.2.5 Login upon signup . . . . . . . . . . . . . . . . . . . 421
8.3 Logging out . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
8.4 Remember me . . . . . . . . . . . . . . . . . . . . . . . . . . 427
8.4.1 Remember token and digest . . . . . . . . . . . . . . 427
8.4.2 Login with remembering . . . . . . . . . . . . . . . . 433
8.4.3 Forgetting users . . . . . . . . . . . . . . . . . . . . . 442
8.4.4 Two subtle bugs . . . . . . . . . . . . . . . . . . . . 444
8.4.5 “Remember me” checkbox . . . . . . . . . . . . . . . 449
8.4.6 Remember tests . . . . . . . . . . . . . . . . . . . . . 456
8.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
8.5.1 What we learned in this chapter . . . . . . . . . . . . 465
8.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466

9 Updating, showing, and deleting users 471


9.1 Updating users . . . . . . . . . . . . . . . . . . . . . . . . . 471
9.1.1 Edit form . . . . . . . . . . . . . . . . . . . . . . . . 472
9.1.2 Unsuccessful edits . . . . . . . . . . . . . . . . . . . 478
9.1.3 Testing unsuccessful edits . . . . . . . . . . . . . . . 479
9.1.4 Successful edits (with TDD) . . . . . . . . . . . . . . 482
9.2 Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . 485
9.2.1 Requiring logged-in users . . . . . . . . . . . . . . . 488
9.2.2 Requiring the right user . . . . . . . . . . . . . . . . 493
CONTENTS ix

9.2.3 Friendly forwarding . . . . . . . . . . . . . . . . . . 498


9.3 Showing all users . . . . . . . . . . . . . . . . . . . . . . . . 503
9.3.1 Users index . . . . . . . . . . . . . . . . . . . . . . . 503
9.3.2 Sample users . . . . . . . . . . . . . . . . . . . . . . 509
9.3.3 Pagination . . . . . . . . . . . . . . . . . . . . . . . 510
9.3.4 Users index test . . . . . . . . . . . . . . . . . . . . . 514
9.3.5 Partial refactoring . . . . . . . . . . . . . . . . . . . . 518
9.4 Deleting users . . . . . . . . . . . . . . . . . . . . . . . . . . 520
9.4.1 Administrative users . . . . . . . . . . . . . . . . . . 520
9.4.2 The destroy action . . . . . . . . . . . . . . . . . . 525
9.4.3 User destroy tests . . . . . . . . . . . . . . . . . . . . 528
9.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
9.5.1 What we learned in this chapter . . . . . . . . . . . . 532
9.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534

10 Account activation and password reset 537


10.1 Account activation . . . . . . . . . . . . . . . . . . . . . . . 538
10.1.1 Account activations resource . . . . . . . . . . . . . . 539
10.1.2 Account activation mailer method . . . . . . . . . . . 546
10.1.3 Activating the account . . . . . . . . . . . . . . . . . 560
10.1.4 Activation test and refactoring . . . . . . . . . . . . . 570
10.2 Password reset . . . . . . . . . . . . . . . . . . . . . . . . . . 576
10.2.1 Password resets resource . . . . . . . . . . . . . . . . 580
10.2.2 Password resets controller and form . . . . . . . . . . 584
10.2.3 Password reset mailer method . . . . . . . . . . . . . 590
10.2.4 Resetting the password . . . . . . . . . . . . . . . . . 597
10.2.5 Password reset test . . . . . . . . . . . . . . . . . . . 603
10.3 Email in production . . . . . . . . . . . . . . . . . . . . . . . 608
10.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
10.4.1 What we learned in this chapter . . . . . . . . . . . . 612
10.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
10.6 Proof of expiration comparison . . . . . . . . . . . . . . . . . 615
x CONTENTS

11 User microposts 617


11.1 A Micropost model . . . . . . . . . . . . . . . . . . . . . . . 617
11.1.1 The basic model . . . . . . . . . . . . . . . . . . . . 618
11.1.2 Micropost validations . . . . . . . . . . . . . . . . . . 620
11.1.3 User/Micropost associations . . . . . . . . . . . . . . 623
11.1.4 Micropost refinements . . . . . . . . . . . . . . . . . 627
11.2 Showing microposts . . . . . . . . . . . . . . . . . . . . . . . 632
11.2.1 Rendering microposts . . . . . . . . . . . . . . . . . 633
11.2.2 Sample microposts . . . . . . . . . . . . . . . . . . . 637
11.2.3 Profile micropost tests . . . . . . . . . . . . . . . . . 642
11.3 Manipulating microposts . . . . . . . . . . . . . . . . . . . . 649
11.3.1 Micropost access control . . . . . . . . . . . . . . . . 650
11.3.2 Creating microposts . . . . . . . . . . . . . . . . . . 652
11.3.3 A proto-feed . . . . . . . . . . . . . . . . . . . . . . 660
11.3.4 Destroying microposts . . . . . . . . . . . . . . . . . 669
11.3.5 Micropost tests . . . . . . . . . . . . . . . . . . . . . 672
11.4 Micropost images . . . . . . . . . . . . . . . . . . . . . . . . 676
11.4.1 Basic image upload . . . . . . . . . . . . . . . . . . . 677
11.4.2 Image validation . . . . . . . . . . . . . . . . . . . . 683
11.4.3 Image resizing . . . . . . . . . . . . . . . . . . . . . 686
11.4.4 Image upload in production . . . . . . . . . . . . . . 688
11.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
11.5.1 What we learned in this chapter . . . . . . . . . . . . 694
11.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695

12 Following users 701


12.1 The Relationship model . . . . . . . . . . . . . . . . . . . . . 702
12.1.1 A problem with the data model (and a solution) . . . . 702
12.1.2 User/relationship associations . . . . . . . . . . . . . 711
12.1.3 Relationship validations . . . . . . . . . . . . . . . . 713
12.1.4 Followed users . . . . . . . . . . . . . . . . . . . . . 715
12.1.5 Followers . . . . . . . . . . . . . . . . . . . . . . . . 719
12.2 A web interface for following users . . . . . . . . . . . . . . 721
12.2.1 Sample following data . . . . . . . . . . . . . . . . . 721
CONTENTS xi

12.2.2 Stats and a follow form . . . . . . . . . . . . . . . . . 723


12.2.3 Following and followers pages . . . . . . . . . . . . . 734
12.2.4 A working follow button the standard way . . . . . . . 744
12.2.5 A working follow button with Ajax . . . . . . . . . . 746
12.2.6 Following tests . . . . . . . . . . . . . . . . . . . . . 753
12.3 The status feed . . . . . . . . . . . . . . . . . . . . . . . . . 755
12.3.1 Motivation and strategy . . . . . . . . . . . . . . . . . 756
12.3.2 A first feed implementation . . . . . . . . . . . . . . 758
12.3.3 Subselects . . . . . . . . . . . . . . . . . . . . . . . . 762
12.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
12.4.1 Guide to further resources . . . . . . . . . . . . . . . 768
12.4.2 What we learned in this chapter . . . . . . . . . . . . 769
12.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
xii CONTENTS
Foreword
My former company (CD Baby) was one of the first to loudly switch to Ruby
on Rails, and then even more loudly switch back to PHP (Google me to read
about the drama). This book by Michael Hartl came so highly recommended
that I had to try it, and the Ruby on Rails Tutorial is what I used to switch back
to Rails again.
Though I’ve worked my way through many Rails books, this is the one that
finally made me “get” it. Everything is done very much “the Rails way”—a
way that felt very unnatural to me before, but now after doing this book finally
feels natural. This is also the only Rails book that does test-driven development
the entire time, an approach highly recommended by the experts but which has
never been so clearly demonstrated before. Finally, by including Git, GitHub,
and Heroku in the demo examples, the author really gives you a feel for what
it’s like to do a real-world project. The tutorial’s code examples are not in
isolation.
The linear narrative is such a great format. Personally, I powered through
the Rails Tutorial in three long days,1 doing all the examples and challenges at
the end of each chapter. Do it from start to finish, without jumping around, and
you’ll get the ultimate benefit.
Enjoy!
Derek Sivers (sivers.org)
Founder, CD Baby

1
This is not typical! Getting through the entire book usually takes much longer than three days.

xiii
Random documents with unrelated
content Scribd suggests to you:
device is attached to the chassis near the pintle to enable it to be
readily traversed when in gear, and give it stability when out of gear.
Eccentric Projectiles. A spherical projectile in which the centre
of inertia does not coincide with the centre of figure. Such projectiles
are subject to great deviations, which can be predicted as to
direction by knowing the position of the centre of inertia of the shot
in the bore of the gun. (See Projectiles, Deviation of.) The side of the
ball upon which the centre of inertia lies can be found by floating it
in a bath of mercury, and marking the highest point where it comes
to a state of rest; the centre of inertia lies nearest the opposite side;
its exact position is determined by a kind of balance called the
eccentrometer; the ball is placed in the balance with the marked
point nearest the fulcrum; the distance of the centre of inertia or
gravity from the fulcrum is obtained by dividing the product of the
counterbalancing weight and its distance from the fulcrum by the
weight of the projectile.
Echarge, Feu, or Feu d’Echarge. Is employed to signify that a
column of troops is struck at a very oblique angle.
Echaugette. In military history, signifies a watch-tower, or kind of
sentry-box.
Echelon. A military term applied to a certain arrangement of
troops when several divisions are drawn up in parallel lines, each to
the right or the left of the one preceding it, like “steps,” or the
rounds of a ladder, so that no two are on the same alignment. Each
division by marching directly forward can form a line with that which
is in advance of it. There are two sorts of echelon, direct and
oblique, the former of which is used in an attack or retreat.
Eckmühl, or Eggmühl. A small village of Bavaria, on the Great
Laber. This place is celebrated for the important victory gained by
the French over the Austrians on April 22, 1809, and which obtained
for Davoust the title of Prince of Eckmühl.
Eclaireurs (Fr.). A corps of grenadiers raised by Bonaparte in
France, who from their celerity of movements were compared to
lightning.
Eclopes (Fr.). A military term to express those soldiers who,
though invalids, are well enough to follow the army. Among these
may be classed dragoons or horsemen whose horses become lame
and cannot keep up with the troop or squadron. They always march
in the rear of a column.
Ecole Polytechnique. A celebrated military school in Paris,
established in 1794, chiefly for the artillery service. The
examinations for the schools are public to all France. It not only
furnishes officers of artillery, but also civil and military engineers of
every description. The pupils of this school defended Paris in 1814
and 1830.
Economy. In a military sense, implies the minutiæ or interior
regulations of a regiment, troop, or company. Hence regimental
economy.
Ecorcheurs (Flayers). A name given to bands of armed
adventurers who desolated France and Belgium during the 15th
century, beginning about 1435, and they at one time numbered
100,000. They are said to have stripped their victims to their shirts,
and flayed the cattle. They were favored by the English invasion and
the civil wars.
Ecoutes. Small galleries made at equal distances in front of the
glacis of the fortifications of a place. They serve to annoy the
enemy’s miners, and to interrupt them in their work.
Ecreter (Fr.). To batter or fire at the top of a wall, redoubt,
epaulement, etc., so as to dislodge or drive away the men that may
be stationed behind it, in order to render the approach more easy.
Ecreter les pointes des palissades is to blunt the sharp ends of the
palisades. This ought always to be done before you attack the covert
way, which is generally fenced by them.
Ecu (Fr.). A large shield which was used by the ancients, and
carried on their left arm, to ward off the blows of sword or sabre.
This instrument of defense was originally invented by the Samnites.
The Moors had ecus, or shields, sufficiently large to cover the whole
of their bodies. The clipei of the Romans only differed from the ecu
in shape; the former being entirely round, and the latter oval.
Ecuador, or Equator. A South American republic, founded in
1831, when the Colombian republic was divided into three; the other
two being Venezuela and New Granada. Gen. Franco was here
defeated in battle by Gen. Flores, August, 1860. Several
insurrections have taken place in Ecuador since 1860.
Edessa, or Callinhoe. An ancient city of Mesopotamia. In 1144
the Edessenes were defeated by the Saracen chief Nur-ed-deen, and
all who were not massacred were sold as slaves. After many
vicissitudes, it fell successively into the hands of the sultans of
Egypt, the Byzantines, the Mongols, Turkomans, and Persians; the
city was finally conquered by the Turks, and has ever since formed a
portion of the Turkish dominion. Its modern name is Oorfa.
Edge. The thin or cutting part of a sword or sabre.
Edgehill. An elevated ridge in Warwickshire, England, 7 miles
northeast from Banbury. Here was fought, on Sunday, October 23,
1642, the first great battle of the civil war, between the royalist
forces under Charles I. and the Parliamentarians under the Earl of
Essex. Prince Rupert, who led the right wing, charged with his
cavalry the left wing of the Parliamentarians, broke it, and pursued it
madly to Keinton. Essex with his force defeated the right wing of the
royalists.
Edinburgh. The metropolis of Scotland, situated about 11⁄2 miles
from the Firth of Forth. It was taken by the Anglo-Saxons in 482;
retaken by the Picts in 695; city fortified and castle rebuilt, 1074;
besieged by Donald Bane, 1093. The city was taken by the English in
1296; surrendered to Edward III. in 1356. It was burnt by Richard
II., 1385, and by Henry IV., 1401. A British force landed from a fleet
of 200 ships, in 1544, and burned Edinburgh. The castle surrendered
to Cromwell in 1650. The young Pretender occupied Holyrood
September 17, 1745, and the battle of Preston Pans took place
September 21, 1745.
Effective. Fit for service; as, an army of 30,000 effective
(fighting) men.
Efficient. A thoroughly trained and capable soldier. It is also a
term used in connection with the volunteers. A volunteer is said to
be efficient when he has performed the appointed number of drills
and fired the regular number of rounds at the target, in the course
of the year.
Egham. A village in the northwest of Surrey, 18 miles west of
London. In the vicinity is Runnymede, a meadow on the Thames,
where King John conferred with his barons before signing the Magna
Charta in 1215.
Egypt. A country in Northeast Africa. On the division of the
Roman empire (395 A.D.) Egypt became a part of the dominions of
Arcadius, ruler of the Eastern empire. But, owing to religious feuds
of the Jacobites and Melchites, it became a province of Persia (616)
for twelve years. In 640 the governor, Makaukas, endeavored to
make himself independent, and invited the arms of the Arabs, and
Amrou easily conquered Egypt. Although Alexandria was retaken by
Constantine III., the Arabs drove him out and maintained their
conquest, and Egypt remained an appendage of the caliphate. It
afterwards passed into the dynasty of the Turks, and was
administered by pashas. Constant rebellions of the Mamelukes, and
the violence of contending factions, distracted the country for more
than two centuries. The most remarkable event of this period was
the French invasion by Bonaparte in 1798, which, by the conquest of
Alexandria and the battle of the Pyramids against the Mamelukes,
led to the entire subjection of the country, from which the French
were finally expelled by the Turks and British in 1801, and the
country restored to the Ottoman Porte. The rise of Mohammed Ali in
1806 imparted a galvanic prosperity to Egypt by the destruction of
the Mamelukes, the formation of a regular army, and the
introduction of European civilization. He considerably extended its
boundaries, even into Asia; but in 1840 he was dispossessed of his
Asiatic conquests. The treaty of London, however, in 1841,
confirmed the viceroyalty of Egypt as a fief of the Ottoman empire to
him and his descendants.
Ehrenbreitstein. A town and fortress of Rhenish Prussia,
situated on the right bank of the Rhine, directly opposite Coblentz,
with which it is connected by a bridge of boats. The fortress of
Ehrenbreitstein occupies the summit of a precipitous rock 490 feet
high, and has been called the Gibraltar of the Rhine, on account of
its great natural strength and its superior works. It is capable of
accommodating a garrison of 14,000 men, and provisions for 8000
men for ten years can be stowed in its vast magazines.
Ehrenbreitstein was besieged in vain by the French in 1688, but fell
into their hands in 1799, after a siege of fourteen months. Two years
after, the French, on leaving, at the peace of Lunéville, blew up the
works. It was assigned, however, to Prussia by the Congress of
Vienna in 1814, and under that country was restored and thoroughly
fortified. It is now one of the strongest forts in Europe.
Eighty-ton Gun. A large Woolwich gun designed as an
armament for the “Inflexible.” Its construction was authorized in
March, 1874, and the gun was ready for proof in October, 1875.
When first made it weighed 81 tons, having a caliber of 141⁄2 inches.
It was bored during the progress of the experiments to 16 inches,
and was given an enlarged chamber. The experiments were
conducted by the celebrated “Committee on Explosion.” See
Ordnance, Recent History of.
Eilau-Preussisch. A town of Prussia, government of Königsberg.
It is chiefly celebrated for the victory gained there by the French
over the united Prussian and Russian armies, February 8, 1807.
Einsiedeln. A small town of Switzerland, in the canton of
Schwytz. It contains a fine abbey, which was rifled by the French in
1798.
Ejector. The device used in breech-loading small-arms to throw
out the metallic cartridge-case after it is fired.
Ejector Spring. The spring which operates an ejector.
El Arish. A village of Lower Egypt on the Mediterranean, on the
route from Egypt to Syria. It is but little more than a fort and a few
houses, and was taken by the French in 1799; and here the French
general Kleber signed, in 1800, a convention with Sir Sydney Smith,
engaging to leave Egypt with his troops.
Elath, or Eloth. A seaport situated at the head of that gulf of the
Red Sea, to which it gave its name. It was a fortified port in the time
of Solomon; revolted against Joram; was retaken by Azariah; and
was eventually conquered by Rezui, and held by the Syrians till it
became a Roman frontier town. Under the Mohammedan rule it rose
for a while to some importance, but has now sunk into
insignificance.
Elba. An island belonging to the kingdom of Italy, in the
Mediterranean Sea, between Corsica and the coast of Tuscany, from
the latter of which it is separated by a channel 5 miles in breadth.
Elba has been rendered famous in history from having been
Napoleon’s place of exile from May, 1814, till February, 1815.
El Boden. A mountain-range, near Ciudad Rodrigo, in Spain,
where the British troops distinguished themselves against an
overwhelming French force in 1811.
Elbow-gauntlet. An ancient piece of armor, a gauntlet of plate
reaching to the elbow, adopted from the Asiatics in the 16th century.
Elbow-piece. An ancient piece of armor, a metal plate used to
cover the junction of the rere-brace and rant-brace, by which the
upper and lower half of the arm were covered.
Elchingen. A village of Bavaria, on the Danube, 7 miles northeast
from Ulm. Here the Austrians were defeated by the French in 1805.
For this victory Marshal Ney received the title of Duke of Elchingen.
Electric light. An intense light produced by passing an electric
current between points of carbon forming electrodes of the circuit.
There are many forms of the apparatus. It will be extensively used in
future wars for lighting harbor channels, approaches to forts, etc.
Elements. In a military sense, signify the first principles of
tactics, fortification, and gunnery.
Elephant. See Pack and Draught Animals.
Elevate, To. Is to raise the muzzle of the cannon or rifle so that
the latter shall be directed at a point above that which it is intended
shall be struck.
Elevating Arc. In gunnery, is an arc attached to the base of the
breech parallel to the ratchets and graduated into degrees and parts
of a degree. A pointer attached to the fulcrum points to the zero of
the scale when the axis of the piece is horizontal. Elevations and
depressions are indicated by the scale. Besides the graduations on
the arc, the ranges (in yards) and charges for shot and shell are
given.
Elevating Bar. An iron bar used in elevating guns or mortars
having ratchets at the breech.
Elevating Screw. The screw by means of which the breech of a
cannon is raised, the result being to depress the muzzle.
Elevating Sight. See Sight, Elevating.
Elevation. In gunnery, is one of the elements of pointing, being
the movement of the axis of a piece in a vertical plane as
distinguished from direction or its movement horizontally. The
elevation is usually positive,—that is, the gun is pointed above the
horizontal. When it is pointed below, it is said to be depressed. The
word is also used to express degree, or as a synonym for angle of
elevation. The sights or elevating apparatus of guns are graduated
on the theory that the object is in the horizontal plane of the piece,
or that the line of sight is horizontal, which is not always the case in
practice. When the elevation is determined by sights the angle of
elevation is the angle between the line of sight and the axis of the
piece, when these lines are in the same vertical plane,—or the angle
between the line of sight and a plane containing the axis of the
piece and a horizontal line intersecting it at right angles, when they
are not. The graduations of tangent scales and fixed breech-sights
give this angle in degrees. The graduation of the pendulum hausse
gives the angle correctly only when the line of sight is horizontal.
When the elevation is given by elevating arcs or gunner’s quadrant,
the angle of elevation becomes the angle of fire, or the angle which
the axis of the piece makes with the horizontal. Elevation is
necessary to overcome the effect of gravity on the projectile. The
degree of elevation increases with the range. In vacuo the elevation
corresponding to the maximum range is 45°. In the air the angle of
maximum range diminishes with the velocity and increases with
diameter and density of the ball. It is greater in mortars than in
howitzers, and greater in howitzers than in guns. In mortars it
approximates to 42°; in guns it is about 37°.
Ellisburgh. A village of Jefferson Co., N. Y. In 1814 an
engagement took place here between the Americans and British, in
which the latter were defeated.
Elmina. A fortified town and seaport of West Africa, founded by
the Portuguese in 1481; was the first European settlement planted
on the coast of Guinea. It was taken by the Dutch in 1637, and was
ceded by them to Portugal. It was burned by the British troops in
1873.
Elsass (Fr. Alsace). One of the old German provinces, having the
Rhine on the east and the Vosges Mountains on the west. It was
ceded to France in 1648; but after the Franco-German war was
annexed by Prussia, under treaty of May 10, 1871.
Elswick Compressor. An arrangement for compressing friction
plates used in the English navy to take up the recoil of gun-carriages
upon their slides. The 7 friction plates arranged longitudinally under
the carriage and attached to its lower part, have alternating between
them 6 long flat bars attached at their ends to the slide by bolts
passing through them, but allowing them a side motion. The plates
and bars are tightly clamped by short rocking levers, the lower ends
of which act on the outside plates. The levers are worked by collars
on a threaded shaft, which catch their upper ends. The shaft is
called the compressor shaft, and has a handle or crank on the
outside of each cheek or bracket,—one is called the adjusting lever,
the other the compressor lever. The first is used to give an initial
compression to suit the charge, the other is operated by the recoil
being forced down by a tripper on the slide. Two forms of the
compressor are used,—one for the single plate, the other for the
double-plate carriage. In the double-plate carriage the adjusting
lever can be set to any degree of compression without causing any
motion in the compressor shaft or lever.
Elswick Gun. Armstrong gun (which see).
Elvas. A strong frontier town of Portugal, in the province of
Alemtejo, situated on a rocky hill, 10 miles northwest from Badajos.
It is one of the most important strongholds in Europe. The arsenal
and bomb-proof barracks are capable of containing 6000 or 7000
men. In 1808 it was taken and held for five months by the French.
Emaum Ghaur. In Scinde, was a strong fortress in the Thur or
Great Sandy Desert, separating that province from the rajpoot state
of Jessulmere. It was captured by Sir Charles Napier in January,
1843.
Embark. To put or cause to go on board a vessel or boat; as, to
embark troops. To go on board of a ship, boat, or vessel; as, the
troops embarked for Egypt.
Embarkation. The act of putting or going on board of a vessel.
Embaterion. A war-song of the Spartans, accompanied by flutes,
which they sung marching in time, and rushing on the enemy. The
origin of the embaterion is lost in antiquity.
Embattle. To arrange in order of battle; to draw up in array, as
troops for battle; also, to prepare or arm for battle.
Embattle. To furnish with battlements. “Embattled” house.
Embattlement. An indented parapet; battlement.
Embezzlement. See Appendix, Articles of War, 60.
Emblazonry. See Blazonry.
Emblee (Fr.). A prompt, sudden, and vigorous attack, which is
made against the covert way and outworks of a fortified place.
Embody. To form or collect into a body or united mass; as, to
embody troops.
Embrasseur (Fr.). A piece of iron, which grasps the trunnions of
a piece of ordnance, when it is raised upon the boring machine, to
widen its caliber.
Embrasure. In fortification, is an opening in the parapet, or a
hole in the mask wall of a casemate through which the guns are
pointed. The sole or bottom of the embrasure is from 21⁄2 to 4 feet
(according to the size of the gun) above the platform upon which
the gun stands. Parapet embrasures are smallest at the interior
opening, which is called the mouth, and is from 11⁄2 to 2 feet wide.
The widening of the embrasure is what is called the splay. The sole
slopes downward about one in six. Its exterior line, or its intersection
with the exterior slope, is usually made half the length of the sole.
The line which bisects the sole is called the directrix. The sides are
called cheeks. The masses of earth between embrasures are called
merlons. When the directrix makes an angle with the direction of the
parapet, the embrasure is oblique. The embrasures of casemates
have in horizontal section a shape something like an hour-glass. The
nearest part is called the throat. This is sometimes closed with iron
shutters.
Embrocher. A vulgar term used among French soldiers to signify
the act of running a man through the body; literally to spit him.
Emery. A powder made by grinding a mineral,—corundum,—used
by soldiers for cleaning their arms.
Eminence. A high or rising ground, which overlooks and
commands the low places about it. Such places, within cannon-shot
of any fortified place, are a great disadvantage, if the besiegers
become masters of them.
Emir, or Emeer. An Arabic word, equivalent to “ruler,” is a title
given to all independent chieftains, and also to all the actual or
supposed descendants of Mohammed through his daughter Fatima.
In former times, the title of Emir was borne by the leaders in the
religious wars of the Mohammedans, and by several ruling families.
Emissary. A person sent by any power that is at war with
another, for the purpose of creating disaffection among the people of
the latter.
Emousser (Fr.). To blunt, to dull. In a military sense, it signifies
to take off the four corners of a battalion, which has formed a
square, and to give it, by those means, an octagon figure; from the
different obtuse angles of which it may fire in all directions.
Emperor (Imperator). Among the ancient Romans, signified the
general of an army, who, for some extraordinary success, had been
complimented with this appellation. Subsequently it came to
denominate an absolute monarch or supreme commander of an
empire. In Europe, the first who bore the title was Charlemagne.
Empilement (Fr.). From empiler, to pile up. The act of disposing
shot and shell in the most secure and convenient manner. This
generally occurs in arsenals and citadels.
Emprise. A hazardous attempt upon the enemy.
Encamp. To form and occupy a camp; to halt on a march, spread
tents, and remain for a night or for a longer time; as, an army or
company.
Encampment. The pitching of a camp. The act of pitching huts
or tents, as by an army, for temporary lodging, or rest; the place
where an army or company is encamped. There are intrenched
camps, where an army is intended to be kept some time, protected
against the enemy; flying camps, for brief occupation; camps of
position, bearing relation to the strategy of the commander; and
camps of instruction, to habituate the troops to the duties and
fatigues of war.
Enceinte. In fortification, denotes generally the whole area of a
fortified place. Properly, however, it means a cincture or girdle, and
in this sense the enceinte signifies the principal wall or rampart
encircling the place, comprising the curtain and bastions, and having
the main ditch immediately outside it.
Encircle. To pass around, as in a circle; to go or come round; as,
the army encircled the city.
Encombrer (Fr.). In fortification, to fill up any hollow place, such
as a stagnant lake, etc., with rubbish.
Encompass. To describe a circle about; to go around; to encircle;
to inclose; to environ; as, an army encompasses a city; a ship’s
voyage encompasses the world.
Encounter. A meeting with hostile purpose; hence, a combat; a
battle.
Encounter. To come against face to face; to engage in conflict
with; to oppose; as, two armies encounter each other.
Encounters. In military affairs, are combats or fights between
two persons only. Figuratively, battles or attacks by small or large
armies.
Encroachments. The advancement of the troops of one nation
on the rights or limits of another.
Enemy. In military language, the opposing force; as, “We have
met the enemy, and they are ours.”
Enfans Perdus. Forlorn hope, in military history, are soldiers
detached from several regiments, or otherwise appointed to give the
first onset in battle, or in an attack upon the counterscarp, or the
breach of a place besieged; so called (by the French) because of the
imminent danger to which they are exposed.
Enfield Rifle-musket. The service arm of Great Britain prior to
the adoption of breech-loaders; manufactured at Enfield, England, at
the royal small-arms factories. It was first extensively introduced in
1853, and was used during the Crimean war. It had three grooves,
with a twist of about one turn in 6 feet. Before the adoption of the
Martini-Henry, large numbers of those guns were utilized by
converting them into breech-loaders on the Snider principle. The
Enfield rifles, though very serviceable weapons, much better than
the Belgian and Austrian arms imported to the United States during
the civil war, were in almost every respect inferior to the old
Springfield (U. S.) rifle-musket, nearly of the same caliber (.58), the
Enfield being .577. All those weapons have now given place to
various breech-loading arms.
Enfilade. Is to fire in the direction of the length of a line of
parapet or troops; to “rake it,” as the sailors say. In the siege of a
fortress, the trenches of approach are cut in a zigzag, to prevent the
defenders enfilading them from the walls.
Enfilading Batteries. In siege operations are one of the classes
of batteries employed, the other classes being counter and
breaching batteries. Enfilading batteries are located on the
prolongation of the faces and flanks of the works besieged, to
secure a raking fire along the terre-pleins.
Engage. To gain for service; to enlist.
Engage. To enter into conflict; to join battle; as, the armies
engaged in a general battle.
Engagement. A general action or battle, whether by land or sea.
Engarrison. To protect any place by a garrison.
Engen. In Baden; here Moreau defeated the Austrians, May 3,
1800.
Enghien, or Steenkirk. In Southwestern Belgium. Here the
British under William III. were defeated by the French under Marshal
Luxemburg, July 24, 1692.
Engineer, Military. An officer in the service of a government,
whose duties are principally to construct fortifications, to make
surveys for warlike purposes, to facilitate the passage of an army by
the construction of roads and bridges; in short, to execute all
engineering works of a military nature. He is also called upon to
undertake many works which more properly belong to the business
of a civil engineer, such as the survey of the country, the inspection
of public works, and, in short, all the duties of a government
engineer.
Engineering. The business of the engineer; the art of designing
and superintending the execution of railways, bridges, canals,
harbors, docks, the defense of fortresses, etc.
Engineer Corps. In modern nations, the necessity for a corps of
staff-officers, trained to arrange for and overcome the
embarrassments of the movements of an army in the field, has been
thoroughly demonstrated, and hence, in European armies, a trained
staff of officers is organized for this purpose. In the United States a
force of about 300 officers and enlisted men are engaged in these
duties. See Sappers and Miners.
Engineers, Topographical. See Topographical Engineers.
England. The southern and larger division of the island of Great
Britain, and the principal member of the United Kingdom of Great
Britain and Ireland. It was so named, it is said, by Egbert, first king
of the English, in a general council held at Winchester, 829. It was
united with Wales, 1283; with Scotland in 1603; and Ireland was
incorporated with them, January 1, 1801. For previous history, see
Britain; and for further details of battles, etc., see separate articles.
Enlargement. The act of going or being allowed to go beyond
the prescribed limits; as the extending the boundaries of an arrest,
when the officer is said to be enlarged, or under arrest at large.
Enlargement. Enlargements of the bore and vent are injuries
suffered by all cannon that are much used. The term is technically
applied to certain injuries to brass cannon. See Injuries to Cannon.
Enlistment. The voluntary enrollment of men in the military or
naval service.
Enniscorthy. A town of Ireland, in the county of Wexford, on the
river Slaney. It arose in the Norman castle, still entire, founded by
Raymond le Gros, one of the early Anglo-Norman invaders. Cromwell
took this place in 1649; and the Irish rebels stormed and burned it in
1798.
Enniskillen. A town of Ireland, in the county of Fermanagh. This
place is famous for the victory, in 1689, won by the troops of William
III., under Lord Hamilton, over a superior force of James II., under
Lord Gilmoy. The banners taken in the battle of the Boyne hang in
the town-hall of Enniskillen.
Enniskillen Dragoons. A British regiment of horse; it was first
instituted from the brave defenders of Enniskillen, in 1689.
Enrank. To place in ranks or in order.
Enroll. To place a man’s name on the roll or nominal list of a body
of soldiers.
Ensconce. To cover as with a fort.
Enseigne (Fr.). The colors. The French designate all warlike
symbols under the term enseigne; but they again distinguish that
word by the appellations of drapeaux, colors, and etendards,
standards. Drapeaux or colors are particularly characteristic of the
infantry; etendards or standards belong to the cavalry.
Ensemble. Together; the exact execution of the same
movements, performed in the same manner, and by the same
motions. It is the union of all the men who compose a battalion, or
several battalions or companies of infantry and cavalry, who are to
act as if put in motion by the same spring.
Enshield. To cover from the enemy.
Ensiform. Having the shape of a sword.
Ensign-bearer. One who carries a flag; an ensign.
Ensigncy. The rank or office of an ensign.
Ensisheim. In Eastern France; here Turenne defeated the
imperial army, and expelled it from Alsace, October 4, 1674.
Entanglement. Abatis, so called, when made by cutting only
partly through the trunks, and pulling the upper parts to the ground,
where they are picketed.
Entanglement, Wire. Formed by twisting wire round stout
stakes or trees 7 feet apart. The wires are placed about a foot or 18
inches above the ground. The trees-pickets or trees are in two or
three rows, arranged checkerwise, the wires crossing diagonally.
Enter, To. To engage in; to enlist in; as, to enter an army.
Enterprise. An undertaking attended with some hazard and
danger.
Enterpriser. An officer who undertakes or engages in any
important and hazardous design.
Entire, or Rank Entire. A line of men in one continued row by
the side of each other. When behind each other, they are said to be
in file.
Entonnoir (Fr.). The cavity or hole which remains after the
explosion of a mine. It likewise meant the tin case or port-feu which
is used to convey the priming powder into the vent of a cannon.
Entrench, To. Is to construct hastily thrown-up field-works for
the purpose of strengthening a force in position. See Intrench.
Entrepôts. Magazines and places appropriated in garrison towns
for the reception of stores, etc.
Envelope. In fortification, a work of earth, sometimes in the form
of a single parapet, and at others like a small rampart; it is raised
sometimes in the ditch, and sometimes beyond it. Envelopes are
occasionally en zigzag, to inclose a weak ground, where that is
practicable, with single lines. Envelopes, in a ditch, are sometimes
called sillons, contregardes, conserves, lunettes, etc.
Environ, To. To surround in a hostile manner; to hem in; to
besiege.
Enzersdorf. A fortified town of Austria, 8 miles east from Vienna.
Epaule. In fortification, denotes the shoulder of a bastion, or the
place where its face and flank meet and form the angle, called the
angle of the shoulder.
Epaulement (Fr. epaule). In siege works, is a portion of a battery
or earthwork. The siege batteries are generally shielded at one end
at least by epaulements, forming an obtuse angle with the main line
of the battery. The name is often given erroneously to the parapet of
the battery itself, but it applies properly to the flanking return only.
Sometimes the whole of a small or secondary earthwork, including
the battery and its flanks, is called an epaulement; and sometimes
the same name is given to an isolated breastwork intended to shield
the cavalry employed in defending a body of besiegers.
Epaulette. A shoulder-knot worn by commissioned officers of the
army and navy, as a mark of distinction. The insignia of their rank
are usually marked on officers’ epaulettes.
Epauletted. Furnished with epaulettes.
Ephebi. In Grecian antiquity, the name given to the Attic youth
from the age of 18, till they entered upon their 20th year. During this
period they served a sort of apprenticeship in arms, and were
frequently sent, under the name of peripoli, to some of the frontier
towns of Attica to keep watch against foreign invasion.
Epibatæ. In Grecian antiquity, the name given to soldiers whose
duty it was to fight on board ship. They corresponded almost exactly
to the marines of modern naval warfare. The term is sometimes
found in Roman authors to denote the same class of soldiers, but
the general phrase adopted by them is milites classiarii, or socii
navales.
Epignare (Fr.). A small piece of ordnance which does not exceed
one pound in caliber.
Epigoni. A term which signifies “heirs” or “descendants.” It was
applied to the sons of the seven chiefs who conducted an expedition
against Thebes to restore Polynices, and who were all killed except
Adrastus. Ten years later the Epigoni—namely, Alcmæon,
Thersander, Diomedes, Ægialeus, Promachus, Sthenelus, and
Euryalus—renewed the enterprise and took Thebes. The war of the
Epigoni was celebrated by several ancient epic and dramatic poets.
Epinglette (Fr.). An iron needle with which the cartridge of any
large piece of ordnance is pierced before it is primed.
Epinikian. Pertaining to, or celebrating, victory; as an epinikian
ode.
Epirus. A celebrated country of ancient Greece, lying between the
Ionian Sea and the chain of Pindus.
E Pluribus Unum. “One out of many.” A motto adopted by the
United States since their declaration of independence, in 1776.
Epouvante (Fr.). A sudden panic with which troops are seized,
and under which they retreat without any actual necessity for so
doing.
Eprouvette (Fr.). A small mortar to prove the strength of
gunpowder. There are different sorts of eprouvettes, according to
the fancy of different nations who use them. Some raise a weight,
and others throw a shot, to certain heights and distances. As a test
of gunpowder the eprouvette is comparatively worthless, and it has
been generally superseded by instruments for measuring the initial
velocity obtained by firing the powder in the particular gun for which
it is intended. A short mortar is, however, still used, to a certain
extent, for testing the power of modern blasting powders, such as
the mixtures of nitro-glycerine. A very small charge and a heavy shot
of chilled iron which enters two or three inches only into the mortar
are used. The square roots of the ranges (other things being equal)
give the relative powers of the different powders, nearly.
Equalize. To render the distribution of any number of men equal
as to the component parts. To equalize a battalion, to tell off a
certain number of companies in such a manner that the several
component parts shall consist of the same number of men.
Equation of Time. See Time, Mean Solar Time.
Equerry. Any person who is appointed to attend the sovereign, or
prince of the royal blood, upon out-door excursions, and who has
the care and management of their horses.
Eques Auratus. A heraldic term for a knight.
Equestrian. A man who rides on horseback; a horseman; a rider.
Equestrian Order. Among the Romans, signified their knights or
equites; as, also, their troopers or horsemen in the field.
Equip, To. To furnish an individual, a corps, or an army with
everything that is requisite for military service, such as arms,
accoutrements, uniforms, etc.
Equipage. In military matters, is the name given to the
necessaries of the soldier. The equipment of a private is often used
as a name for the whole of his clothes, arms, and accoutrements,
collectively. The equipage of the camp is of two kinds, camp and
field equipage.
Equipments, Cannoneers’. Include the hausse pouch, cartridge
pouches, primer pouches, and thumb-stall, used in the field service.
The equipments for a field-piece are the tampion and strap, vent
cover and tarpaulin. Other things used in service of cannon are
called implements, which see.
Equipments, Horse. In the mounted service, comprise the
bridle, halter, watering bridle, saddle, saddle-bags, saddle blanket,
nose-bag, lariat, curry-comb, brush, etc.
Equipments, Infantry. Comprise the personal outfit of the
soldier, excluding arms proper and clothing. A set of equipments is
called a kit (which see). The standard equipments for infantry
include the knapsack, belts, and plates, cartridge-box, bayonet-
scabbard, haversack, and canteen. The knapsack, haversack, and
canteen are only used in marching. In the United States there is a
strong tendency towards discarding the knapsack; a roll made of the
blanket, piece of shelter-tent, or overcoat, being frequently used
instead. A clothing-bag is also sometimes used to take its place. The
best manner of arranging and slinging the various articles carried,
for the comfort and health of the soldier, is still an open question. In
future wars it is probable that an intrenching tool will be added to
the soldier’s equipment. The equipments for a cavalry soldier in the
United States are very much the same as for infantry.
Equipments, Signal. The flags, staffs, flying torches, fort
torches, flame shades, haversacks, telescopes, etc., used in
signaling. A set of equipments for one man is called a signal kit.
Equites. An order of equestrian knights introduced among the
Romans by Romulus.
Eretria. One of the most celebrated of ancient cities, and, next to
Chalcis, one of the most powerful in Eubœa. After the Peloponnesian
war, the city was governed by tyrants.
Erfurt. A town of Prussian Saxony, on the river Gera; it was
founded in 476. Erfurt was ceded to Prussia in 1802. It capitulated
to Murat, when 14,000 troops surrendered, October 16, 1806. In this
city Napoleon and Alexander met, and offered peace to England,
September 27, 1808. The French retreated from Leipsic to Erfurt,
October 18, 1813. This place was restored to Prussia by the
Congress of Vienna.
Ericius. In Roman antiquity, a military engine, so named from its
resemblance to a hedge-hog. It was a kind of chevaux-de-frise,
placed as a defense at the gate of the camp.
Erie, Fort. A strong fortification in Upper Canada, on the northern
shore of Lake Erie. Here the British were defeated by the Americans,
August 15, 1814.
Erlau. A fortified town of Hungary, the old castle of which was
frequently besieged during the Turkish wars, both by Moslem and
Christian.
Eryx. A city and mountain in the west of Sicily, 6 miles from
Drepana, and a short distance from the sea-shore. The possession of
the town of Eryx was contested by the Syracusans and
Carthaginians. A great battle was fought off the town between the
fleets of the two nations, in which the Syracusans were victorious.
The town subsequently changed hands more than once, but it
seems to have owned the Carthaginian supremacy at the time of the
expedition of Pyrrhus, 278 B.C. Though taken by that monarch, it
once more fell into the hands of its original conquerors, who
retained it till the close of the first Punic war.
Erzroom, Erzroum, or Erzrum. A fortified town of Armenia
(Asiatic Turkey), on the river Kara-Soo, a branch of the Euphrates.
Its position renders it an important military post. In 1210 it was
taken by the Seljooks, who are said to have destroyed here 100
churches; taken by the Ottoman Turks in 1517. It was taken by the
Russians in 1829, but was restored to Turkey in the following year.
Escadron (Fr.). Squadron. Froissart was the first French writer
who made use of the word escadron to signify a troop of horse
drawn out in order of battle. The term escadron is more ancient than
the word battalion.
Escalade. From the Latin scala, a ladder. In siege operations, a
mode of gaining admission within the enemy’s works. It consists in
advancing over the glacis and the covert way, descending, if
necessary, into the ditch by means of ladders, and ascending to the
parapet of the curtain and bastions, and are either procured on the
spot, or are sent out with the siege army. The leaders constitute a
forlorn hope.
Escale (Fr.). A machine used to ply the petard.
Escape of Gas. See Gas-check and Breech Mechanism.
Escarp. In fortification, the surface of the ditch next the rampart,
the surface next the enemy being termed the counterscarp. Called
also scarp.
Escarp Galleries. Galleries constructed in the escarp for the
purpose of flanking the ditch caponnière.
Escarpment. Ground cut away nearly vertically about a position,
in order to render it inaccessible to the enemy.
Escort. A body of troops attending an individual as a guard. The
term is also applied to a guard placed over prisoners on a march, to
prevent their escape, and to the guard of a convoy of stores.
Escort, Funeral. See Funeral Escort.
Escort of Honor. A body of troops attending a personage of rank
by way of military compliment.
Escort of the Color. The military ceremony of sending for and
receiving the colors of a battalion.
Escouade (Fr.). In the old French service generally meant the
third part of a company of foot or a detachment. Companies were
divided in this manner for the purpose of more conveniently keeping
the tour of duty among the men. We have corrupted the term, and
called it squad.
Escuage. An ancient feudal tenure by which the tenant was
bound to follow his lord to war or to defend his castle.
Espadon. In old military works, a kind of two-handed sword,
having two edges, of a great length and breadth; formerly used by
the Spanish.
Espauliere (Fr.). A defense for the shoulder, composed of flexible,
overlapping plates of metal, used in the 15th century; the origin of
the modern epaulette.
Espiere. A town of Belgium, 8 miles from Courtrai, where the
allied Austrian and English army defeated the French, May 22, 1794.
Espingard, or Epingare (Fr.). An ancient name for a small gun
under a 1-pounder. They were used as early as the 14th century.
Espingole, or Spingole (Fr.). A blunderbuss; a kind of
blunderbuss which, in early times, was loaded with several balls; the
charges were separated from each other by tampions in which a
hole was made, and thus the balls were fired in succession.
Espinosa de la Monteros. A town of Spain, on the Trueba, 50
miles from Burgos. The French defeated the Spaniards here in 1808.
Esplanade. In fortification, is the open space intentionally left
between the houses of a city and the glacis of its citadel, so that the
enemy may not be able to erect breaching batteries under cover of
the houses. In old works on fortification, the term is often applied to
the glacis of the counterscarp, or the slope of the parapet of the
covered way towards the country.
Espontoon (Fr.). A sort of half pike, about 3 feet in length, used
in the 17th century. The colonels of corps as well as the captains of
companies always used them in action. This weapon was also used
by officers in the British army.
Espringal. In the ancient art of war, a machine for throwing large
darts, generally called muchettæ.
Esprit de Corps (Fr.). This term is generally used among all
military men in Europe. It may not improperly be defined a laudable
spirit of ambition which produces a peculiar attachment to any
particular corps, company, or service. Officers without descending to
mean and pitiful sensations of selfish envy, under the influence of a
true esprit de corps rise into an emulous thirst after military glory.
The good are excited to peculiar feats of valor by the sentiments it
engenders, and the bad are deterred from ever hazarding a
disgraceful action by a secret consciousness of the duties it
prescribes.
Esquimaux. The tribes inhabiting Greenland and Arctic America.
Those inhabiting the continent are found in sparse settlements from
Behring Strait to Labrador. They are generally peaceable. Some of
these in Greenland have been civilized by the influence of the Danes.
Esquire. In chivalry, was the shield-bearer or armor-bearer to the
knight. He was a candidate for the honor of knighthood, and thus
stood to the knight in the relation of a novice or apprentice. When
fully equipped each knight was attended by two esquires.
Essedarii. In Roman antiquity, gladiators who fought in a heavy
kind of chariot called esseda or essedum. The esseda (which derived
its name from the Celtic word ess, signifying a carriage) was a
ponderous kind of chariot much used in war by the Gauls, the
Belgæ, and the Britons. It differed from the currus in being open
before instead of behind; and in this way the owner was enabled to
run along the pole, from the extremity of which, or even from the
top of the yoke, he discharged his missiles with surprising dexterity.
Essek, or Eszek. A town and fortress of the Austrian empire, in
Sclavonia, on the Drave. It contains an arsenal, barracks, and other
military buildings. There were several battles fought here between
the Turks and Germans. It was finally taken from the Turks in 1687,
since which time it has continued in the hands of the house of
Austria.
Essling. A village of Lower Austria, on the left bank of the
Danube, 6 miles east of Vienna. Between this village and that of
Aspern the French were repulsed by the Austrians in a severe
engagement in 1809. See Aspern.
Establish. A technical phrase to express the quartering of any
considerable body of troops in a country. Thus it is common to say,
the army took up a position in the neighborhood of ——, and
established the headquarters at ——.
Establishment. The quota of officers and men in an army,
regiment, troop, or company.
Establishment, Peace. Is the reduced condition of an army
suited to a time of peace.
Establishment, War. Is the augmentation of regiments to a
certain number, by which the whole army of a country is
considerably increased, to meet war exigencies.
Estacade (Fr.). A dike constructed of piles in the sea, a river, or a
morass, to check the approach of an enemy.
Estafette (Fr.). A military courier, sent express from one part of
an army to another.
Esthonia, or Revel. A Russian province, said to have been
conquered by the Teutonic knights in the 12th century; after various
changes it was ceded to Sweden by the treaty of Oliva in 1660, and
finally to Russia by the peace of Nystadt in 1721, having been
conquered by Peter in 1710.
Estimates. Army estimates are the computation of expenses to
be incurred in the support of an army for a given time.
Estimating Distances. See Pointing.
Estoc (Ital.). A small dagger worn at the girdle, called in
Elizabethan times a tucke.
Estoile. See Etoiles.
Estradiots, or Stradiots. Grecian and Albanian horsemen, some
of whom were employed in the Italian wars by Charles VIII.; their
favorite weapon was the zagaye; besides this they had a
broadsword, and club slung on the bow of the saddle, with sleeves
and gauntlets of mail.
Estramacon (Fr.). A sort of two-edged sword formerly used. A
blow with the edge of a sword.
Etat Major (Fr.). The staff of an army, including all officers above
the rank of colonel; also, all adjutants, inspectors, quartermasters,
commissaries, engineers, ordnance officers, paymasters, physicians,
signal-officers, judge-advocates; also, the non-commissioned
assistants of the above officers.
Etoiles (Fr.). Small redoubts which are constructed by means of
angles rentrant and angles sortant, and have from 5 to 8 salient
points. This species of fortification has fallen into disuse, and are
superseded by square redoubts, which are sooner built and are
applicable to the same purpose of defense.
Etoupille (Fr.). An inflammable match, composed of three threads
of very fine cotton, which is well steeped in brandy mixed with the
best priming gunpowder.
Etruria, or Tuscia (hence the modern name Tuscany). A province
of Italy, whence the Romans, in a great measure, derived their laws,
customs, and superstitions. The subjugation of this country forms an
important part of early Roman history. A truce between the Romans
and Etrurians for forty years was concluded in 351 B.C. The latter and
their allies were defeated at the Vadimonian Lake, 310 B.C.; with the
Boii their allies, 823 B.C., and totally lost their independence about
265 B.C.
Eubœa. The largest island in the Ægean Sea. Two of its cities,
Chalcis and Eretria, were very important, till the former was subdued
by Athens, 506 B.C., and the latter by the Persians, 490. After the
Persian war Eubœa became wholly subject to Athens. It revolted in
445, but was soon subdued by Pericles. After the battle of
Chæronea, 338, it became subject to Macedon. It was made
independent by the Romans in 194, but was afterwards incorporated
in the province of Achaia. It now forms part of the kingdom of
Greece.
Eupatoria, or Koslov. A town of Russia, on the west coast of the
Crimea. In September, 1854, the allied English and French armies
landed near here, and the town soon after was occupied by a small
detachment. The Turks subsequently occupied it, and in 1855 it was
attacked by the Russians, who, however, were repulsed by the Turks,
and the Anglo-French ships of war, lying in the neighboring
roadstead.
Eureka Projectile. See Projectile.
Europe. The least extensive, but most civilized of the five great
divisions of the globe. It is bounded by the sea in all directions,
except the east, where it is separated from Asia by a boundary-line,
formed by the river Kara, the Ural Mountains and River, and the
Caspian Sea. For military and naval events which occurred in Europe,
see separate articles.
Eurymedon (now Kapri-Su). A small river in Pamphylia,
celebrated for the victory which Cimon gained over the Persians on
its banks, 469 B.C.
Eustace, St. In Lower Canada; the rebels were defeated here,
December 14, 1837, and compelled to surrender their arms. Their
chiefs fled.
Eustatius, St. A West India island, which was settled by the
Dutch in 1632; taken by the French in 1689; by the English in 1690;
again by the British forces under Rodney and Vaughan, February 3,
1781. It was recovered by the French, November 26, same year. It
was again captured by the British in 1801 and 1810, and restored to
the Dutch in 1814.
Eutaw Springs. A small affluent of the Santee River, in South
Carolina. On its banks was fought, September 8, 1781, the battle of
this name. Gen. Greene, determining to dispossess the British of
their remaining posts, with about 2000 men attacked their forces
under Col. Stuart. The British were routed and fled; but finding in
their flight some objects affording shelter, rallied and repulsed their
assailants, and Gen. Greene finding it impossible to dislodge them,
retreated to his camp with 500 prisoners. The British loss was about
1000; the American about 600.
Euxine Sea. See Black Sea.
Evacuate. To withdraw from a town or fortress, in consequence
either of a treaty or a capitulation, or of superior orders.
Evagination. An unsheathing or drawing out of a sheath or
scabbard.
Evesham. A borough and market town of England, in
Worcestershire, on the Avon. Near this place a battle was fought
between Prince Edward, son of Henry III., and Simon de Montfort,
earl of Leicester, August 4, 1265.
Evidence. Is that which makes clear, demonstrates, or ascertains
the truth of the very fact or point in issue. Hearsay evidence, the
declaration of what one has heard from others. This species of
evidence is not admissible in courts-martial.
Evocati. Were a class of soldiers among the Romans, who, after
having served their full time in the army, entered as volunteers to
accompany some favorite general. Hence they were likewise called
emereti and beneficiarii.
Evocation. A religious ceremony which was observed among the
Romans at the commencement of a siege, wherein they solemnly
called upon the gods and goddesses of the place to forsake it and
come over to them. When any place surrendered they always took it
for granted that their prayer had been heard.
Evolutions. Are the movements of troops in order to change
position. The object may be to maintain or sustain a post, to occupy
a new post, to improve an attack, or to improve a defense. All such
movements as marching, countermarching, changing front, forming
line, facing, wheeling, making column or line, defiling, deploying,
etc., come under the general heading of evolutions.
Evreux (anc. Mediolanum). A city of France, capital of the
department of Eure. It has sustained several sieges, and was burned
by Henry I. of England in 1119.
Examination, Boards of. See Boards of Examination.
Exarchs. Were appointed by the Byzantine emperors of the East,
to govern Central Italy after its conquest by Belisarius and Narses,
548. They ruled from 568 to 752, when Eutychus, the last, was
overcome by Astolphus the Lombard.
Exauctoratio. In the Roman military discipline, differed from the
missio, which was a full discharge, and took place after soldiers had
served in the army twenty years; whereas the exauctoratio was only
a partial discharge; they lost their pay, indeed, but still kept under
their colors or vexilla, though not under the aquila or eagle, which
was the standard of the legion; whence instead of legionarii, they
were called subsignani, and were retained till they had either served
their full time, or had lands assigned them. The exauctoratio took
place after they had served seventeen years.
Excavation. The art of cutting or otherwise making hollows in
the earth; also the cavity formed.
Exchange. The act of two officers changing regiments,
battalions, or batteries. The mutual giving up of an equal number of
prisoners by hostile states or armies. In this sort of exchange an
officer, according to his rank, is reckoned as equal to a certain
number of men or of officers of a lower grade than his own.
Excubiæ. In ancient warfare, the watches and guards kept in the
day by the Roman soldiers. They differed from the vigiliæ, which
were kept in the night.
Execution, Military. Is the pillaging or plundering of a country
by the enemy’s army. Military execution also means every kind of
punishment inflicted in the army by the sentence of a court-martial;
which is of various kinds, including putting a soldier to death by
shooting him, which is the ordinary punishment of deserters to the
enemy, mutineers, etc. This form of death is considered less
disgraceful than hanging by the neck.
Exempt. Not subject, not liable to. Men of certain age are exempt
from serving in the militia. An aide-de-camp and brigade-major are
exempt from all regimental duties while serving in those capacities.
Officers on courts-martial are sometimes exempt from all other
duties until the court is dissolved.
Exercise. The practice of all those motions and actions, together
with the whole management of arms, which are essential to the
perfection of a soldier, and the rendering him fit for service.
Exercise, Artillery. Is the method of teaching the regiments of
artillery the use and practice of all the various machines of war
belonging to that particular arm of the service.
Exon. In England, an officer of the Yeomen of the Royal Guard;
an exempt.
Exostre (Fr.). Bridge of the Helepole or movable tower of the
ancients, by which they passed upon a wall during a siege.
Expanding System of Projectiles. See Projectiles, Rifle.
Expedient. A stratagem in warfare.
Expedition. Is an enterprise taken by sea or by land against an
enemy, the fortunate termination of which depends on the rapidity
and unexpected nature of its movements. It is usually intrusted to a
commander of acknowledged talents and experience.
Expense Magazines. Are small powder-magazines containing
ammunition, etc., made up for present use. There is usually one in
each bastion.
Experiments. The trials or applications of any kind of military
machines in order to ascertain their practical qualities and uses.
Expiration of Service. The termination of a soldier’s contract of
enlistment.
Explode. To burst with a loud report; to detonate, as gunpowder,
or a shell filled with powder or the like material.
Explosion. The sudden enlargement of the volume of a body by
its conversion into gas or vapor. (See Explosives.) The explosion of
powder may be divided into three distinct parts, viz.: ignition,
inflammation, and combustion, all of which see under their proper
headings.
Explosives. Substances the elements of which under certain
conditions suddenly undergo a chemical rearrangement into gases,
giving rise to great pressures on surrounding bodies. Modern writers
recognize two different kinds of explosions,—explosions of the 1st
order, or detonations, and explosions of the 2d order, or rapid
combustions. Detonating explosions are practically instantaneous.
The explosion is supposed to be propagated by a vibration
throughout the mass. Ordinary explosions are propagated by
inflammation. Gunpowder, which may be taken as a type of
explosives of the 2d order, burns at a certain rate, depending upon
the density. When a charge is fired the inflammation spreads from
the point of ignition to all parts of the charge,—each grain is
successively enveloped and burned from surface to centre. The
velocity of inflammation is the greater in proportion to the degree of
confinement from the increased tension of the gases. The velocity of
combustion is the rate at which the solid grains are burned. It is
measured by the distance passed over by the burning surface (the
line being taken perpendicular to the surface) in the unit of time.
Time thus enters into the explosion of gunpowder and gives it its
peculiar value as a ballistic agent.
In the detonating explosives, the case is very different. These
bodies may be supposed to be made up of molecules containing so
many atoms of carbon, oxygen, nitrogen, etc., so placed as to be
held in a state of equilibrium by their mutual attractions and
repulsions, but this equilibrium is unstable; that is to say, each atom
has only a very small arc of vibration in which the molecule is stable.
If by any cause an atom is forced beyond this limit the equilibrium of
the whole mass is destroyed, and the elements instantly rearrange
themselves under the influence of the chemical affinities which
obtain under the particular conditions of the explosion. This kind of
explosion is brought about in various ways,—by percussion,
concussion, heat, etc.,—some bodies being susceptible to one mode
of firing more than another. The theory which offers the best
explanation of the various phenomena is that the molecular balance
is peculiarly susceptible to overturn by certain vibrations. The
vibrations given out by the explosion of the fulminates seem to have
the widest range in bringing about the detonation of different
substances. For this reason the fulminate of mercury is the universal
detonating agent. Its own susceptibility to explosion by heat,
percussion, and the electric spark especially fits it for this work. Wet
gun-cotton requires in addition to the fulminate a “primer” of dry
gun-cotton.
Explosives, Composition of. Ordinary explosives of which
gunpowder is the type are mechanical mixtures of two essential
ingredients,—one a combustible, the other an oxidizing agent. The
combustible is usually carbon,—sometimes associated with
hydrogen. It may be sulphur or any substance having a great affinity
for oxygen. Organic substances containing carbon and hydrogen are
frequently used. In the chemical reaction the carbon is oxidized to
carbonic acid and the hydrogen to water with the evolution of great
heat.
The oxidizing substances ordinarily used are the nitrates and
chlorates. Mixtures containing nitrates are the most stable, since the
nitrate is comparatively slow to give up its oxygen. The chlorate
mixtures are sensitive to friction and percussion, and explode with
great quickness. Many of them are unsafe to handle. A new mode of
preparing chlorate mixtures has been suggested which avoids this
danger. A combustible liquid is used, being absorbed in cakes or
lumps of potassium or other chlorate.
Detonating explosives are chemical compounds. Among them are
chloride and iodide of nitrogen. Both are dangerous, violent
explosives of which no practical use has been made.
The fulminates are salts of fulminic acid. The fulminate of mercury
is the one in common use. See Fulminates.
The nitro-substitution compounds form a large class, comprising
the most important of the higher explosives. They are all formed by
the action of nitric acid on organic substances containing oxygen,
carbon, and hydrogen. This action is to replace hydrogen (H) in the
organic substance by hyponitric acid (NO2) (in the acid), equivalent
for equivalent. Sulphuric acid is generally mixed with the nitric,
though it plays no direct part in the reaction, being used to absorb
the water formed and prevent the dilution of the nitric acid.
Nitro-glycerine, the most powerful explosive in common use, is
formed by the action of the acids on glycerine. See Nitro-glycerine.
Nitro-starch and nitro-mannite are analogous substances, formed
by the action of the acids on starch and sugar.
Gun-cotton is produced by the action of the acids on cotton-wool
—a form of cellulose. See Gun-cotton.
There are varieties of all these compounds produced, by the
substitution of different numbers of equivalents of hyponitric acid,
but the names are specially given to the most highly nitrated forms.
Picric acid, the salts of which form the well-known picrates, is
made by the action of the acids on carbolic acid.
To heighten the effect of the lower forms of nitro-substitution
compounds they are usually mixed with an oxidizing agent, such as
nitrate or chlorate, which supplies the deficient oxygen. This is
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like