addis_a
1
Since I began to develop a big application as a Rails engine I have been
noticing some annoying things, especially with gems.
First is Spring. Since it’s a core gem I would expect it to be well
supported for engines, but it’s not. I opened two issues, one about not
working fast enough https://github.com/rails/spring/issues/316 and
another about problems running the Rails server
https://github.com/rails/spring/issues/323. Both were opened on July
2014.
The second gem is jquery-ui-rails, which does not seem to work with
engines
https://github.com/joliss/jquery-ui-rails/issues/90.
Why are these things happening? Aren’t engines good enough to be
considered
as first-class citizens?
Apart from adding them on gemspec dependency , you need to also require
it
explicitly inside the engine.rb or lib/your_engine_name.rb on top
Eg:
lib/your_engine_name.rb
require ‘jquery-ui’
module YourEngineName
end
OR
module YourEngineName
class Engine < ::Rails::Engine
isolate_namespace YourEngineName
require ‘jquery-ui’
end
end
Engines work fine . We’re using 9 engines in production for a while.
Only a
few bugs with named routes sometimes but that can be ignored .
On Wed, Jan 21, 2015 at 2:39 PM, David Morales
<[email protected]
Thanks Vivek, you are totally right. So much time since I added the last
gem to my project
Spring issues continue to be annoying. It forced my to use Zeus, but
since
Spring is in the core it should be fully supported, don’t you think?
El miércoles, 21 de enero de 2015, 10:17:25 (UTC+1), Vivek S.
escribió:
Hi,
I dont mean to be rude but i have no idea what you’re talking about
Spring
? Zues ? Core ?
On Wed, Jan 21, 2015 at 3:34 PM, David Morales
<[email protected]