Last active
August 29, 2015 13:56
-
-
Save jsborjesson/9211178 to your computer and use it in GitHub Desktop.
Generates a new secret token in a Rails app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This oneliner generates a new secret_token.rb file, | |
| # just paste it in your terminal at the root of your project | |
| # and it will take care of the rest. | |
| echo "$(rails r "p Rails.application.class.parent_name" | sed "s/\"//g")::Application.config.secret_token = '$(rake secret)'" > ./config/initializers/secret_token.rb |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also run the no-magic version and just replace
MyAppwith the name of your app.