Class: Crawlable::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/engine.rb

Instance Method Summary collapse

Instance Method Details

#add_helpers(*clazzes) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/engine.rb', line 9

def add_helpers(*clazzes)
  clazzes.each do |clazz|
    clazz.class_eval do
      include ApplicationHelper

      if defined?(::Rails)
        if ActionPack::VERSION::MAJOR == 3
          include ::Rails.application.routes.url_helpers
        else
          require 'action_controller'
          include ActionController::UrlWriter
        end
        default_url_options[:host] = 'localhost:3000'
      end
    end
  end
end