-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add support for using view components in rails engine #1951
Open
tkowalewski
wants to merge
16
commits into
ViewComponent:main
Choose a base branch
from
tkowalewski:component_template_with_module_namespacing
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add support for using view components in rails engine #1951
tkowalewski
wants to merge
16
commits into
ViewComponent:main
from
tkowalewski:component_template_with_module_namespacing
Conversation
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
👋 Just a quick nudge to say #1308 means you'll need to rebase this branch for checks to pass. |
tkowalewski
force-pushed
the
component_template_with_module_namespacing
branch
2 times, most recently
from
January 10, 2024 17:43
2c551bf
to
3ba0a7c
Compare
tkowalewski
force-pushed
the
component_template_with_module_namespacing
branch
2 times, most recently
from
March 14, 2024 19:25
18c846c
to
1910a72
Compare
First step to add support for using view components in rails engine
tkowalewski
force-pushed
the
component_template_with_module_namespacing
branch
from
May 14, 2024 18:47
1910a72
to
5c16496
Compare
tkowalewski
changed the title
WIP: Add support for using view components in rails engine
Add support for using view components in rails engine
May 17, 2024
There is problem with tests for |
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.
What are you trying to accomplish?
I'm trying to add support for generating view components in the module (engine) namespace in rails engine.
To do it we need to wrap templates code with
module_namespacing
(provided by rails)How to test
Update gemspec (
engine_with_test.gemspec
)Update
spec.homepage
Update
spec.summary
Update
spec.description
Update
spec.metadata["source_code_uri"]
Update
spec.metadata["changelog_uri"]
Add view_component to
Gemfile
app/components/engine_with_test/example_component.html.erb
)Uncomment test (
test/components/engine_with_test/example_component_test.rb
)Run tests
and go to
http://localhost:3000/rails/view_components
What approach did you choose and why?
There is only one solution to deliver view components for rails engine with module (engine) namespace: Wrap templates code with
module_namespacing
:)Anything you want to highlight for special attention from reviewers?
test/dummy
)engine_test
) was added to Rakefile