I have a Rails Engine I'm working on and the gemspec has this:
s.add_development_dependency "rspec-rails"
s.add_development_dependency "combustion"
s.add_development_dependency "capybara"
s.add_development_dependency "factory_girl_rails"
s.add_development_dependency "ffaker"
s.add_development_dependency "draper"
s.add_runtime_dependency "sqlite3"
s.add_runtime_dependency "slim-rails"
s.add_runtime_dependency "sass-rails"
s.add_runtime_dependency "jquery-rails"
s.add_runtime_dependency "rails", "~> 3.2"
However upon going to the correct controller/action I get this error:
Missing template countdown/subscriptions/index, countdown/application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder]}. Searched in: * "/Users/krainboltgreene/Repository/ruby/countdown/spec/dummy/app/views" * "/Users/krainboltgreene/Repository/ruby/countdown/app/views"
Notice the handlers part?
You should require the gem in lib/your_engine.rb
. If you only require it in your dummy app's config/application.rb
, then others are going to have this same problem when include your engine in their apps.
This can be especially confusing because in regular Rails app development. It's easy to rely on Bundler.require to load all of your gems for you.
http://myronmars.to/n/dev-blog/2012/12/5-reasons-to-avoid-bundler-require
I had a similar problem with the dummy application not loading Devise. What I had to do was require it inside config/application.rb
and then it worked. Perhaps you just need to require 'slim'
there and it will work too?
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