0

I find this problem a little funky, and need more sets of eyes. I'm making a super simple gem that makes the backbone.eventbinder.js file available to the Rails app that requires this gem.

The problem is that when I add gem 'backbone_eventbinder_rails', path: '/path/to/repo' to my app's Gemfile, I can see the file at http://localhost:3000/assets/backbone.eventbinder.js. When I use gem 'backbone_eventbinder_rails', '1.0.2.2', I cannot see the asset. I get a No route matches [GET] "/assets/backbone.eventbinder.js error.

Any ideas?

Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69
  • Have you tried specifying a route? --||-- http://apidock.com/rails/ActionController/Routing#300--use-route-to-force-named-routes-in-url-for --||-- http://stackoverflow.com/questions/5200654/how-do-i-write-a-rails-3-1-engine-controller-test-in-rspec – westonplatter Dec 18 '12 at 20:26

1 Answers1

0

It looks like the gem isn't picking up the vendor files.

I would change:

s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]

To:

s.files         = `git ls-files`.split($/)
s.executables   = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
s.test_files    = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ["lib"]

Otherwise I thinks it's got somehting to do with:

module BackboneEventbinderRails
  class Engine < ::Rails::Engine
  end
end

being changed to:

class BackboneEventbinderRails::Engine < ::Rails::Engine
end

in version 1.0.2.2

And why move Engine to a seperate file? Since the gem only makes javascript available i wouldn't bother about lib.