Methods
A
C
H
N
R
Instance Public methods
app(create=false)

reference the global “app” instance, created on demand. To recreate the instance, pass a non-false value as the parameter.

    # File railties/lib/rails/console/app.rb, line 12
12:     def app(create=false)
13:       @app_integration_instance = nil if create
14:       @app_integration_instance ||= new_session do |sess|
15:         sess.host! "www.example.com"
16:       end
17:     end
controller()
   # File railties/lib/rails/console/helpers.rb, line 7
7:     def controller
8:       @controller ||= ApplicationController.new
9:     end
helper()
   # File railties/lib/rails/console/helpers.rb, line 3
3:     def helper
4:       @helper ||= ApplicationController.helpers
5:     end
new_session()

create a new session. If a block is given, the new session will be yielded to the block before being returned.

    # File railties/lib/rails/console/app.rb, line 21
21:     def new_session
22:       app = Rails.application
23:       session = ActionDispatch::Integration::Session.new(app)
24:       yield session if block_given?
25:       session
26:     end
reload!(print=true)

reloads the environment

    # File railties/lib/rails/console/app.rb, line 29
29:     def reload!(print=true)
30:       puts "Reloading..." if print
31:       ActionDispatch::Reloader.cleanup!
32:       ActionDispatch::Reloader.prepare!
33:       true
34:     end