Add configurable project_path option#104
Open
0000marcell wants to merge 4 commits into
Open
Conversation
eb2e1c1 to
815df91
Compare
- Add config.project_path setting with Rails.root.to_s fallback - Use configured path in debug visitor, meta tags, and template checking - Useful for Docker mounts and monorepo structures 💘 Generated with Crush Assisted-by: Crush:claude-sonnet-4.5
815df91 to
00c4d92
Compare
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.
This pull request adds support for configuring a custom project path for editor integration in ReActionView, improving flexibility for projects using Docker, monorepos, or non-standard Rails root paths. It also updates documentation and internal logic to use the new configuration, and improves test assertions.
Behavior is the same but now we have the correct path and the link works!
Video showing usage in a docker project:
screenrecording-2026-05-23_15-38-39.mp4
Editor Integration and Project Path Configuration:
project_fullpathconfiguration option toReActionView::Config, allowing users to specify a custom project path for "open in editor" links. This is used in place ofRails.rootwhen set. (lib/reactionview/config.rblib/reactionview/config.rbR8-R21)project_fullpath(falling back toRails.root), including editor links, debug visitors, and meta tags. (lib/reactionview/template/handlers/herb.rb[1] [2] [3] [4]Documentation Updates:
project_fullpathoption in both the README and installation guide, including practical examples for Docker and monorepos. (README.md[1]docs/docs/installation.md[2]project_fullpath. (lib/generators/reactionview/install_generator.rblib/generators/reactionview/install_generator.rbR26-R28)Testing Improvements:
assert_not_nilfor better clarity. (test/reactionview_test.rbtest/reactionview_test.rbL7-R7)## SummaryAdds a configurable
project_pathoption to ReActionView that allows customizing the project root path used for editor integration and dev tools.Motivation
When using ReActionView in environments where the project path differs from
Rails.root(e.g., Docker containers with volume mounts, monorepo structures), the dev tools and editor integration may not work correctly. This PR makes the project path configurable.Changes
config.project_pathattribute toReActionView::ConfigHerbhandler to use configured path withRails.root.to_sfallbackherb-project-pathmeta taglocal_template?checkingUsage
Use Cases
Docker with volume mounts:
Monorepo structure:
Testing
All existing tests pass. The change is backwards compatible (defaults to
Rails.root.to_s).