Over a million developers have joined DZone.

Request Database Authentication When Rails Boots

DZone's Guide to

Request Database Authentication When Rails Boots

Free Resource
Simple solution to a problem that may not affect very many folks.
If you don't like your password displayed in plain text in database.yml, this might help you.
It utilizes the Highline gem (big thanks to James Edward Gray II).

# database.yml

require 'highline/import'

def request_input(msg, show_input = true)
  ask(msg) { |q| q.echo = show_input }

  username: <%= request_input 'Username: ' %>
  password: <%= request_input 'Password: ', false %>

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}