Sha256: 27d8d79c60471702362a9020682243774c901f958817a8ba8b959bc81d05bbd3

Contents?: true

Size: 955 Bytes

Versions: 1

Compression:

Stored size: 955 Bytes

Contents

require 'action_controller/helpers'

module ActionController #:nodoc:
  module Helpers #:nodoc:
   
    private

      # in Ruby 1.9.3 and Rails 2.3, every controller MUST
      # have a helper. see http://groups.google.com/group/rubyonrails-core/browse_thread/thread/81be70a119260e59 
      # This sucks, lets monkeypatch it!
      def default_helper_module!
        unless name.blank?
          module_name = name.sub(/Controller$|$/, 'Helper')
          module_path = module_name.split('::').map { |m| m.underscore }.join('/')
          require_dependency module_path
          helper module_name.constantize
        end
      rescue MissingSourceFile => e
        raise unless e.is_missing? module_path
      rescue NameError => e
        raise unless e.missing_name? module_name
      # added hackery starts here
      # this is the missing rescue!
      rescue LoadError => e
        puts "no helper found for controller #{name}"
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
itrigga-ruby19_hacks-0.1.2 lib/itrigga/ruby19_hacks/rails23.rb