Closed gregorw closed 9 years ago
When developing a Rails engine, the server is started from spec/dummy or test/dummy. However, the view lookup expects the root directory.
spec/dummy
test/dummy
See https://github.com/apotonick/cells/blob/master/lib/cell/templates.rb#L24: return unless File.exists?("#{prefix}/#{view}")
return unless File.exists?("#{prefix}/#{view}")
Here, prefix is something like app/cells/mycell, but Dir.pwd is spec/dummy. So, the view template in app/cells/mycell/show.slim is never found.
prefix
app/cells/mycell
Dir.pwd
app/cells/mycell/show.slim
This is documented here: http://trailblazerb.org/gems/cells/engine.html
Very helpful. Thanks!
:wink:
When developing a Rails engine, the server is started from
spec/dummy
ortest/dummy
. However, the view lookup expects the root directory.See https://github.com/apotonick/cells/blob/master/lib/cell/templates.rb#L24:
return unless File.exists?("#{prefix}/#{view}")
Here,
prefix
is something likeapp/cells/mycell
, butDir.pwd
isspec/dummy
. So, the view template inapp/cells/mycell/show.slim
is never found.