-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 ability to specify custom mount url for admin back-end #1300
Comments
👍 IMHO, "/refinery" is an implementation detail the user shouldn't have to care about. |
In discussing this with @parndt, we identified 3 possible ways of supporting this in refinery, in descending order of preference: 1. Add configuration options in Refinery::Core that are referenced in the routes.This is the approach taken in this pull request to refinerycms-blog, which we (@parndt, @ugisozols, and myself) all agreed was not the best approach. 2. Split the refinery engine into two pieces for the frontend and backend to allow specifying two mount points.Using something like the following:
... allows customizing the admin path but will also change the user facing path. This means all of your pages would have paths like "/my_custom_path/home" instead of "/home". To avoid this, refinery could be split into two engines and then mounted like this:
This might work, but would require a significant refactoring of refinery to support isolating the two engines from each other, and might introduce unforeseen complications that make working with refinery more painful than it is now. 3. Add a method that the user calls in their routes file that defines refinery's routes.Similar to how Devise has devise_for methods to define its routes. This would enable the user to do something like the following:
(Note: I made the name intentionally stupid to make an effective placeholder.) Pros:
Cons:
What do you guys think? |
I remember I was having an idea for dual engine like |
Personally, I like the
|
I like @andrewhavens proposal: mount Refinery::Frontend::Engine, :at => '/'
mount Refinery::Backend::Engine, :at => '/admin_panel' So we would have to add two small engines for backend and frontend and add routes inside these engines. After that we should change Sounds like a plan? |
@ugisozols I'm +1 for this approach. If you can point me to start, I have time to do this. |
I'm torn. On one hand, I rather like the flexibility offered by mounting two separate engines, but on the other hand, this adds a layer of complexity to engine development and to mounting. It's also going to mean we're going to have non-standard installs all over the place, and we're going to have to keep that in mind when troubleshooting. On the other hand, I hate the Devise-like approach because it is so opaque. Powerful, yes, but very opaque. Tertiarily, I kind of like the separate mountable engines idea purely for the thought that it might lead someday to the creation of Refinery-backended web services. 👍 to Frontend/backend engines. |
I don't like the added complexity that this requires. I don't want to write code like this: link_to "ugliness", refinery_backend.admin_pages_path And this link_to "moar ugliness", refinery_frontend.pages_path /me shrugs |
I haven't experimented with this but what if we could use two engines It's late for me so I'll stop here and will play around with the above tomorrow (if someone won't beat me already). |
That would be amazingly ideal, @ugisozols |
@ugisozols: That would make the seperate engine implementation a lot nicer. I vote for solution #3, but I can tell that's not a popular opinion. ;) |
I agree with @phiggins who inadvertently referenced issue 3 just now. |
I tried two engines ( |
As per discussion with @parndt, we'll be saving this for 2.1. |
So, let's come back to this: can we do this / do we want to do this for 2.1? This is actually a really big change, and could very well break compatibility — I'm tempted to leave this until Refinery 3... thoughts? |
I think this is a really important feature. I wish it could have made it into 2.0. Version 3.0 seems so far away, but maybe it's not? |
I'll revisit this soon. |
I'm going to close this, and move this to the Roadmap for the unspecified issue. Nobody seems to have time to do this now, and though we're all in agreement, barring an implementer, this is a non-starter and its presence here is obscuring the other more accomplishable issues. If anyone disagrees and thinks that this is critical for 2.1 or 2.2, feel free to reopen. |
We now have the ability to mount the entire Refinery engine at a custom subdirectory:
However, this affects both the front-end and back-end. If you wanted to access the front-end at
/
but the back-end at/admin_panel
, there's currently no way to do this. I think it would be a useful and important feature to be able to specify the Refinery back-end url, either from a config file, or in theroutes.rb
file. Maybe something like this:I think this is even more important for non-english speaking users.
/refinery
might be ok for english speaking users, but I doubt that it's easy to remember for non-english speakers.The text was updated successfully, but these errors were encountered: