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

app:template did not install default component files correctly. #38

Open
helpotters opened this issue Aug 31, 2023 · 1 comment
Open
Assignees
Labels
question Further information is requested

Comments

@helpotters
Copy link

What did you do?

Ran rails app:template LOCATION="https://railsbytes.com/script/zJosO5".

What did you expect to happen?

For it to install the default component files so it can correctly generate rails g view_component Example later.

What actually happened?

During installation, it failed to set the appropriate file extensions for .haml. Instead of component.html.haml, it made component.html.tt. No errors were raised, leading to it not generating .haml and preview.rb files during rails g view_component Example.

Additional Context

This is not a fresh installation of ViewComponents, I had existing components already.

Environment

I am using HAML and esbuild.

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
gem 'view_component', '~> 3.5'
gem 'erb2haml', '~> 0.1.5', group: :development
gem 'jsbundling-rails', '~> 1.1'
gem 'cssbundling-rails'
gem 'haml-rails'

Ruby Version:

ruby '3.2.0'

Framework Version (Rails, whatever):

rails 7.0.4

View Component Contrib Version:

"view_component-contrib", "~> 0.1.4"

@palkan
Copy link
Owner

palkan commented Sep 15, 2023

Hey @helpotters,

Can you please show the contents of the lib/generators/view_component/view_component_generator.rb file generated by the rails app:template ... command?

@palkan palkan added the question Further information is requested label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants