Let the templates generator generate 100% compatible Haml templates with the Rails' original ERB templates#197
Merged
amatsuda merged 19 commits intohaml:masterfrom Sep 28, 2025
Merged
Conversation
e97f73e to
20ff0fd
Compare
bd509c9 to
36256f2
Compare
36256f2 to
9f4703d
Compare
This was referenced Sep 29, 2025
|
Hello, it seems the symlinks are causing troubles on non-unix platforms. ruby/rubygems#9296 Would it be accepted to provide PR removing symlinks and resolving the issue in different way? |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current haml-rails gem includes a set of templates (that are unmaitained for a decade) for generating Haml templates via
rails gcommand, and I suppose some of them might be outdated and won't work on recent versions of Rails (like, recently reported on #196).So, this patch introduces a new mechanism for the scaffold generator to switch the template templates per the currently running Rails' version.
Plus, actual template files for all supported Rails versions: i.e. 5.1, 5.2, 6.0, 6.1, 7.0, 7.1, 7.2, 8.0.
For testing this approach, I added a new test case that generates scaffold templates for both ERB and Haml, then actually renders all of them on a real Rails app, then compares the rendered HTML results one by one.