Where to store sensitive data in public rails app?

TLDR: Use environment variables! I think @Bryce’s comment offers an answer, which I’ll just flush out. It seems one approach Heroku recommends is to use environment variables to store sensitive information (API key strings, database passwords). So survey your code and see in which you have sensitive data. Then create environment variables (in your .bashrc … Read more

.js.erb VS .js

.js.erb files are for controller actions, such as create, when you want javascript to be executed when the action completes. For example, when you want to submit a form via ajax and want display an alert when everything is done, you would put the $(‘#business_submit’).click(…) in your application.js or *.html.erb, and your create.js.erb could look … Read more

Ruby 1.9.2 and Rails 3 cannot open rails console

Apparently ubuntu and ruby don’t always catch dependencies like they should. From the first google hit (yeah, I clicked on this stack-overflow in place #2 before checking out the first result.) Navigate to the Ruby source and enter: sudo apt-get install libreadline5-dev cd ext/readline ruby extconf.rb make sudo make install So, if you’re on another … Read more

Heroku – Display hash of current commit in browser

It’s now possible to try the Heroku feature Roberto wrote about in his answer, without contacting Heroku. It’s called Heroku Labs: Dyno Metadata and you can enable it by heroku labs:enable runtime-dyno-metadata -a <app name> and then the information is available (on the next deploy) as environment variables: ~ $ env HEROKU_APP_ID: 9daa2797-e49b-4624-932f-ec3f9688e3da HEROKU_APP_NAME: example-app … Read more