$ command line ruby cheat sheets
Cheat Sheet Title: [ no_spaces_alphanumeric_only ]
Cheat Sheet:Special Variables: app helper Specifying console environment (defaults to development): $ script/console production $ script/console test $ script/console development Loading a session for debugging: >> session = Marshal.load(File.open(’tmp/sessions/ruby_sess.8eb9614a7e4e1e3b’)) => {”hash”=>{:cart=… >> cart = session[”hash”][:cart] Reloading the console: >> reload! Rollback all database changes on exit: $ script/console --sandbox Loading development environment in sandbox. Any modifications you make will be rolled back on exit. >> To maintain history across console sessions, add the following to ~/.irbrc: require 'irb/ext/save-history' IRB.conf[:SAVE_HISTORY] = 100 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" See also: $ cheat rails_console
Your cheat sheet will be editable (fixable) by anyone. Each cheat sheet is essentially a wiki page. It may also be used by millions of people for reference purposes from the comfort of their command line. If this is okay with you, please save.
Advertisement