Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (39 sloc) 1.1 KB
---
console: "Special Variables:\r\n\
\r\n\
app\r\n\
helper\r\n\
\r\n\
Specifying console environment (defaults to development):\r\n\
\r\n\
$ script/console production\r\n\
$ script/console test\r\n\
$ script/console development\r\n\
\r\n\
Loading a session for debugging:\r\n\
\r\n\
>> session = Marshal.load(File.open(\xE2\x80\x99tmp/sessions/ruby_sess.8eb9614a7e4e1e3b\xE2\x80\x99))\r\n\
=> {\xE2\x80\x9Dhash\xE2\x80\x9D=>{:cart=...}}\r\n\
>> cart = session[\xE2\x80\x9Dhash\xE2\x80\x9D][:cart]\r\n\
\r\n\
Reloading the console:\r\n\
\r\n\
>> reload!\r\n\
\r\n\
\r\n\
Rollback all database changes on exit:\r\n\
\r\n\
$ script/console --sandbox \r\n\
Loading development environment in sandbox.\r\n\
Any modifications you make will be rolled back on exit.\r\n\
>> _\r\n\
\r\n\
To maintain history across console sessions, add the following to ~/.irbrc:\r\n\
\r\n\
require 'irb/ext/save-history'\r\n\
IRB.conf[:SAVE_HISTORY] = 100\r\n\
IRB.conf[:HISTORY_FILE] = \"#{ENV['HOME']}/.irb-save-history\"\r\n\
\r\n\
See also:\r\n\
\r\n\
$ cheat rails_console"