Skip to content
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

Configurable root path #306

Closed
wants to merge 3 commits into from

Conversation

tomasc
Copy link

@tomasc tomasc commented Sep 16, 2020

This PR allows for configuration of the root path, where Scenic looks up its views:

Scenic.configure do |config|
  config.root_path = MyEngine.root
end

The default value stays Rails.root.

This is a follow up to #237 (comment) and addresses #261.

@derekprior
Copy link
Contributor

@tomasc how would this work in cases where both the engine and the app itself want to use Scenic?

@trevorrjohn
Copy link

I would think you need two config files for that, one in the engine and one at the app level. Or you could add a env var or argument to override the "default" path.

@derekprior
Copy link
Contributor

The configuration is currently a singleton, so I don't think that would work

@derekprior
Copy link
Contributor

We have a number of proposed changes (see: view-paths ) that cover this same functionality. I think #237 is closest to something we would consider merging in that covers multiple use cases. Swapping one static path for another would solve some problems but create others.

@derekprior derekprior closed this Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants