Replies: 2 comments
-
You can register your own preview url - even several sources admins can select from are possible. Preview window URL configurationBy default Alchemy uses its internal page preview renderer, Basic Auth is supported. Example
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the pointers, @tvdeyen. I was able to locate the problem, but it seems like it is actually more or less a Rails bug. Engines don't get the right paths from the URL helpers by default. In case anyone else runs into this, I was able to work around this by doing:
This code should be inserted before the routes are drawn. I also opened an issue in Rails for this, rails/rails#44919. |
Beta Was this translation helpful? Give feedback.
-
Steps to reproduce
Configure Rails with a relative URL root. https://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root
Expected behavior
Alchemy should only use URLs with the specified root.
Actual behavior
The preview window attempts to access the non-relative root /. For example, assume RAILS_RELATIVE_URL_ROOT is "/subdir" and Alchemy is mounted on "cms". The preview will then attempt to load e.g.
/cms/admin/pages/1
, which doesn't exist, while it should instead load/subdir/cms/admin/pages/1
. It is possible this same issue is present in other parts of the code as well.System configuration
Beta Was this translation helpful? Give feedback.
All reactions