Hey Andrew, Assuming the ajax calls are to the same root url as the app that is calling them then you can just point the calls to the path, i.e.: '/something' instead of 'http://localhost:3000/something'. If the ajax calls are coming from a different domain then using just the path won't work. In that case I'd reach for something like Config Spartan ( https://github.com/cjbottaro/config_spartan) to define the url to the other app for each environment, once for development and once for production (and probably test too). Then your ajax call would look something like: ` $.get("#{ AppConfig.other_app_url }"/something) `
You shouldn't need to have two different repos, that will cause lots of unnecessary headaches (as you're already experiencing). Cheers On Sun, Jan 11, 2015 at 6:08 PM, Andrew Haines <[email protected]> wrote: > Greetings Fellow Problem Solvers, > > I want to open up a quick discussion on best practices for deployment of > Rails apps. > > As my application has grown, I have found that each deployment has become > more and more of a pain. > Certain files on my local code have changed slightly from files on the > server. For example, I have ajax calls written in javascript and the URLs > are hardcoded. So for my local code, the url would be > localhost:3000/something. On the server it is > https://hourslogger.com/something. This means I can't just upload all my > files at once, or I will introduce bugs that will break the app. I can't > just have the app break because of the number of users we have. > > I currently run the app on Digital Ocean. I have 2 Git repos; one for the > local code and one for the production server. My current deployment process > is to keep a list of the files that are different and upload those files > individually. I assume all the other files are the same (meaning local = > server). I feel like this is error prone/ hacky so I wanted to ask for > advice. > > I am building out my test suite to try and catch these problems when they > happen, but is there a better way to deploy or a best practices to follow? > AKA Tools where you can deploy with a click of a button, and not have it > break the app. > > I appreciate any help from software gurus greater than I =) > > - Drew Haines > DevCo > > > -- > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > --- > You received this message because you are subscribed to the Google Groups > "SD Ruby" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
