I'm trying to bootstrap AngularJS into a Rails engine using the rails-assets-angular
gem.
However, when I start the server on the parent app (the app my engine is mounted in), I get this error: couldn't find file 'angular'
.
Here's my application.js
:
//= require angular
//= require_tree .
Here's my .gemspec
:
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "lesson_notes/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "lesson_notes"
s.version = LessonNotes::VERSION
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.add_dependency "rails", "~> 4.0.4"
s.add_dependency "rails-assets-angular"
s.add_development_dependency "pg"
s.add_development_dependency "rspec", "~> 2.14.1"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "capybara", "~> 2.2.1"
s.add_development_dependency "factory_girl_rails", "~> 4.0"
s.add_development_dependency "rails-assets-angular-mocks"
s.add_development_dependency "database_cleaner", "~> 1.2.0"
s.test_files = Dir["spec/**/*"]
end
And my Gemfile
:
source "https://rubygems.org"
source "https://rails-assets.org"
gemspec
Figured it out!
In lib/engine_name/engine.rb add require "rails-assets-angular"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With