-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support variants with dots in their names (#1585)
This follows the same principles as commit 95ceed1. Quoting that commit: > ViewComponent defines variant method calls with `def > call_#{variant}`, which results in invalid Ruby code when the variant > contains a [dash or dot]. Replacing dots with triple underscores in the method definition (similar to what Bundler does when converting hostnames to environment variables [1]) and modifying the code getting the variant so it includes dots in the variant name solves the issue. [1] https://bundler.io/man/bundle-config.1.html#CONFIGURE-BUNDLER-DIRECTORIES
- Loading branch information
Showing
5 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
test/sandbox/app/components/variants_component.html+mini-watch.erb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Mini Watch | ||
Mini Watch with dash |
1 change: 1 addition & 0 deletions
1
test/sandbox/app/components/variants_component.html+mini.watch.erb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Mini Watch with dot |
This file contains 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