@HuyVo ... so on rails if you're spending more than a day on it - you're likely fighting the system (or you have an off by one error you haven't found) ... in your case the issue is you should not be using a decorator with an api ... especially a json one where the industry standard is serialization & there have hundreds of gems for json specification to do thousands of tasks ... maybe I'm just not grasping terminology - but it really sounds like you're working against how rails is made
ah! you're not talking about generating layout but formating field - good stuff Huy!
@LucianTarna you're like the 5th person we've had with these issues behind ngix ... i first for the assets not serving up correctly though, the issue one guy had was directory permissions were right, but everytime he precompiled - he had to change the file permissions before the other server could see it ... i can't recall but the https is a firewall thing ... do you have another machine in there or did you just not setup the ngix routing right?
Also ... Lucian, is your VM coworker's VM a self contained network or just a server on the VM reaching out across the network via the same NGIX server you're using?
(should note the guy who was having permission issues with precompiling just upgraded to rails 5 eventually & issue went away)
precompiling of the assets during production for rail is actually a thing btw - so you might want to actively decide if it's worth chasing this issue - if as you said precompiling solves all problems for all servers
you use the word "it" too much for me to tell what you are talking about :)
(can't tell which 'it')
so back to the vm setup ... you're saying you have 8 containers ... I asked if the ngix is in the same VM setup on the same server as the ubuntu rails server ... yes/no?
next ... inside the vm setup is nginx on the same virtual server as the ubuntu rails server? yes/no (i just need to be sure we're not chasing firewall/routing issues - cause they can look the same - and with different OS they totally handle security differently)
# Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true
me either to be honest - but it looks like the fix should be file permissions, so just make sure you remember to check the path/dir etc exists and you chown it each time you mess with image/vagrant
so at this point you need a vagrant/ubuntu expert to check the permissions are changing and vagrant isn't overriding or silently saying nope
either that or if you have to wait on one, try pulling the nginx out of the equation?
right ... @LucianTarna the last thing, some of the sprockets type gems work from the local temp directly instead of their own & even if the results are stored else where, they are created in the /vagrant/tmp (type directory) and then moved elsewhere afterwards if the programmers are lazy
shrugs, never code dove vagrant or the rails asset pipeline code - I kind of consider them both dead ends (in terms of rails with options out there like api to modern front end)