About Me

My photo
जिंदगी की परीक्षा में कोई नम्बर नहीं मिलते है लोग आपको दिल से याद करे तो समझ लेना आप पास हो गए....

Thursday 4 February 2016

Rails 4 way notes 1

1. Rails 4, generating a new application will result in the creation of binstubs for Rails executables, located
in the bin folder. A binstub is a script containing an executable that runs in the context of the bundle. This
means one does not have to prefix bundle exec each time a Rails specific executable is invoked. Binstubs are
also first class citizens in Rails 4, and should be added into your version control system like any other source
code file.
By default, the following stubs are available on every new Rails 4 project:
• bin/bundle
• bin/rails
• bin/rake

To add a binstub of a commonly used executable in your bundle, invoke bundle binstubs some-gem-name .
To illustrate, consider the following example:
$ bundle binstubs guard
which creates a binstub for guard in the bin folder.

2.Secret Token
Certain types of hacking involve modifying the contents of cookies without the server knowing about it.
By digitally signing all cookies sent to the browser, Rails can detect whether they were tampered with. The
secret_token.rb initializer contains the secret key base, randomly generated along with your app, which is
used to sign cookies.

p15
ref: rails 4 way

No comments:

Post a Comment