diff --git a/lib/turbograft.rb b/lib/turbograft.rb index 9f5f2493..23473d27 100644 --- a/lib/turbograft.rb +++ b/lib/turbograft.rb @@ -35,10 +35,8 @@ def referer end ActiveSupport.on_load(:action_view) do - (ActionView::RoutingUrlFor rescue ActionView::Helpers::UrlHelper).module_eval do - prepend XHRUrlFor - end - end unless RUBY_VERSION =~ /^1\.8/ + (ActionView::RoutingUrlFor rescue ActionView::Helpers::UrlHelper).prepend(XHRUrlFor) + end end end end diff --git a/turbograft.gemspec b/turbograft.gemspec index 6a2eadce..eac2c848 100644 --- a/turbograft.gemspec +++ b/turbograft.gemspec @@ -18,6 +18,8 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.required_ruby_version = '~> 2.1' + spec.add_dependency "coffee-rails" spec.add_development_dependency "bundler"