I'm deploying a Rails 6 application into a subfolder (/dictionnaire-app). I set config.relative_url_root = "/dictionnaire-app" in application.rb and also added the ENV variable according to the documentation.
However, if assets are properly rendered, links generated with the link_to method are not updated accordingly.
I read many questions related to this problem and tried to create a scope in my routes.rb file, following these instructions.
Rails.application.routes.draw do
mount ForestLiana::Engine => '/forest'
root to: "home#index"
scope 'dictionnaire-app' do
resources :words, path: "definition", param: :slug
post '/search', to: 'words#search'
get '/recherche', to: 'words#search_page'
get '/:letter', to: 'words#alphabet_page', param: :letter, as: "alphabetic_page"
end
end
Unfortunately the app throws an error saying the page doesn't exist for this URL : https://www.lalanguefrancaise.com/dictionnaire-app/definition/rameal
However, this URL works: https://www.lalanguefrancaise.com/dictionnaire-app/dictionnaire-app/definition/rameal
Any idea of how can I solve this issue and render the app on /dictionnaire-app/*?
Thanks.
Edit: this issue seems to be from Rails (see here). Any way to find a work around?