I’m creating a rails mountable engine plugin which uses the gem “jquery-rails”. I added this code in .gemspec file
s.add_dependency "jquery-rails", "~> 3.0.1"
bundle update. (BTW is this adding necessary? Since rails mountable engine already added “rails 4.0.1” which in turn required “jquery-rails 3.0.4” as its dependency from the start?).
//= require jquery //= require jquery-ujs //= require_tree .
But when I run the server on test/dummy/ and access any template which uses the tag
I tried creating a brand new mountable engine plugin but it happens the same.
Did I do something wrong?
PS. Sorry for my English.
I know the original question was asked a few months ago, but I ran into the same problem while working through the Rails engine tutorial, so I’m posting in case this helps others…
I found that I needed to update four files:
1.) add a dependency to your .gemspec file
#file: <your engine name>.gemspec s.add_dependency "jquery-rails", "~> 3.1.1"
2.) update your engine application.js file:
3.) update your parent app application.js file:
4.) per this SO thread, you need to add a require to your engine.rb file:
#file: lib/<your engine name>/engine.rb module <your engine name> class Engine < ::Rails::Engine require 'jquery-rails' isolate_namespace Blorgh end end