Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to convert an application layout of an engine #108

Open
petrosp opened this issue Feb 8, 2016 · 2 comments
Open

Unable to convert an application layout of an engine #108

petrosp opened this issue Feb 8, 2016 · 2 comments

Comments

@petrosp
Copy link

petrosp commented Feb 8, 2016

Hey guys,
While the rails g haml:application_layout works fine in nornal Rails app, it does not when I run it from an engine:

~/railsengine$ rails g haml:application_layout
~/railsengine/vendor/bundle/gems/haml-rails-0.9.0/lib/rails/generators/haml/application_layout/application_layout_generator.rb:11:in `convert': undefined method `join' for nil:NilClass (NoMethodError)

I run it correctly without errors under ~/railsengine/spec/dummy:

~/railsengine/spec/dummy$ rails g haml:application_layout
Success! app/views/layouts/application.html.haml is created.
Please remove the erb file: app/views/layouts/application.html.erb

Is haml-rails designed to not to run in Rails engines?

Thanks a bunch.

@serv
Copy link
Contributor

serv commented Feb 8, 2016

@petrosp I am not familiar with how Rails engines, but I think error is caused by the fact that Rails engine do not have Rails.root where as regular Rails apps do. (Also see: http://stackoverflow.com/questions/5117729/rails-is-there-an-engine-root)

I'll defer to @indirect decide how we should support haml-rails' use case for rails engines.

@indirect
Copy link
Member

@petrosp as currently coded, the haml-rails generators do not work with engines. I honestly have no idea how to write generators that work with engines, but I'd be willing to merge a pull request that handles it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants