trailblazer / cells

View components for Ruby and Rails.
https://trailblazer.to/2.1/docs/cells.html
3.07k stars 236 forks source link

Template lookup does not work for Rails engines #293

Closed gregorw closed 9 years ago

gregorw commented 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.

See https://github.com/apotonick/cells/blob/master/lib/cell/templates.rb#L24: 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.

apotonick commented 9 years ago

This is documented here: http://trailblazerb.org/gems/cells/engine.html

gregorw commented 9 years ago

Very helpful. Thanks!

apotonick commented 9 years ago

:wink: