mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Make all ActionView helpers available in the console for debugging purposes.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4008 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
*SVN*
|
||||
|
||||
* Make all ActionView helpers available in the console for debugging purposes. n.b.: Only an 80% solution. Some stuff won't work, most will. [Marcel Molina Jr.]
|
||||
|
||||
ex.
|
||||
|
||||
>> puts options_for_select([%w(a 1), %w(b 2), %w(c 3)])
|
||||
<option value="1">a</option>
|
||||
<option value="2">b</option>
|
||||
<option value="3">c</option>
|
||||
=> nil
|
||||
|
||||
* Replaced old session rake tasks with db:sessions:create to generate a migration, and db:sessions:clear to remove sessions. [Rick Olson]
|
||||
|
||||
* Reject Ruby 1.8.3 when loading Rails; extract version checking code. [Chad Fowler]
|
||||
|
||||
@@ -13,6 +13,7 @@ libs = " -r irb/completion"
|
||||
libs << " -r #{RAILS_ROOT}/config/environment"
|
||||
libs << " -r console_app"
|
||||
libs << " -r console_sandbox" if options[:sandbox]
|
||||
libs << " -r console_with_helpers"
|
||||
|
||||
ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
|
||||
if options[:sandbox]
|
||||
|
||||
15
railties/lib/console_with_helpers.rb
Normal file
15
railties/lib/console_with_helpers.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module Kernel
|
||||
def include_all_modules_from(parent_module)
|
||||
parent_module.constants.each do |const|
|
||||
mod = parent_module.const_get(const)
|
||||
if mod.class == Module
|
||||
send(:include, mod)
|
||||
include_all_modules_from(mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require 'application'
|
||||
@controller = ApplicationController.new
|
||||
include_all_modules_from ActionView
|
||||
Reference in New Issue
Block a user