Create a script that includes the resources of a project


#1

Hi!
What includes/requires should I write to create a separate console
script that includes all the resources (models) of a Rails project (like
script/console) ?

Thanks.
Nicolas.


#2

require ‘path/to/rails_root/config/boot’
require ‘path/to/rails_root/config/environment’
require ‘irb/completion’
require ‘console_app’
require ‘console_sandbox’
require ‘console_with_helpers’

you probably want to specify this on the command-line to irb like
script/console does.

Take a look at /path/to/lib/ruby/gems/1.8/gems/rails-1.x.x/lib/
commands/console.rb for more info

On Mar 11, 6:00 pm, Nicolas B. removed_email_address@domain.invalid