I deploy the crm in a suburl (e.g. /var/www/crm) and state ':base_url: "/crm"' in my settings. When I call the application I am getting an 'Routing Error: No route matches [GET] "/"'. Passenger handles it, so I have to set base_url to "/". Most parts of ffc are now working, but not all. Assets and ajax routes are not found: GET https://server.local/assets/avatar.jpg [HTTP/1.1 404 Not Found 2ms].
Anybody knows how to fix it?
Hi @mck9, thanks for reporting this issue.
I believe I have fixed the assets and ajax routes to honor the base_url setting, please update from the master branch and try again.
Updated from master. Sorry, but that wasn't it. Now with "/" as base_url the application wants to load this URL: https://assets/iconset_attribution-be9d089183efa02735825b86ddb6155c.png
Why do you have this base_url setting anyway?
OK. I can't use "/crm", because of -> Routing Error: No route matches [GET] "/"
The Routing Error is expected behaviour in that case... The Rails app will not handle any requests for /, because every request URL needs to start with /crm. Apache will be serving assets from /crm/assets,
and the Rails application will handle requests to /crm/contacts, /crm/accounts, /crm/admin, etc...
If you use a base_url of /crm, then you should be visiting http://example.com/crm, and not http://example.com/.
I think you misunderstood my issue. I have a setup with Apache and Passenger. The ffcrm app is registered like that:
RailsBaseURI /crm. I do call http://example.com/crm
Ah I see, sorry about the confusion.
Could you please try the following steps:
- scope Setting.base_url do
+ scope "" do
(Get rid of the scope, which I don't think is necessary when you use Passenger's RailsBaseURI)
Done that. Some issues are resolved, others remain:
I think this is due to absolute URLs in CSS and JS files..
OK, I've just pushed changes that remove the routing scope. Have fixed those two URLs you mentioned, you are right that they were absolute URLs in JS files (so just bugs).
Were those the only remaining issues?
Thanks for the update. Works mostly:
GET https://server/assets/asterisk.gif [HTTP/1.1 404 Not Found 2ms]
GET https://server/assets/chosen-sprite-6bf2d1950160ce2fbfb76968fadae3f1.png [HTTP/1.1 404 Not Found 2ms]
Is this still an issue?
Will close for now. Ping me if it's a problem