Skip to content

Instantly share code, notes, and snippets.

@tyre
Created April 23, 2013 16:53
Show Gist options
  • Save tyre/5445372 to your computer and use it in GitHub Desktop.
Save tyre/5445372 to your computer and use it in GitHub Desktop.
function rails_console {
local version=$(rails -v | grep -o 'Rails [0-9]' | grep -o '[0-9]')
if [[ "$version" == "2" ]]; then
./script/console
elif [[ "$version" -gt "2" ]]; then
rails c
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment