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'
Can you please show the contents of the lib/generators/view_component/view_component_generator.rb file generated by the rails app:template ... command?
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 ofcomponent.html.haml
, it madecomponent.html.tt
. No errors were raised, leading to it not generating.haml
andpreview.rb
files duringrails 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.
Ruby Version:
ruby '3.2.0'
Framework Version (Rails, whatever):
rails 7.0.4
View Component Contrib Version:
"view_component-contrib", "~> 0.1.4"