<warning>This post is more of me talking about my grievances while doing the project and learning some stuff along the way..</warning>
The main problem I had was working with document.ready. I always had the idea that document.ready would always start or run when a page is loaded. Either when first entering the website or clicking a link to navigate elsewhere. Which is true. Depending on your environment. This is when I discovered something in rails that was never covered before in our lectures. Basic info but nice to know. So rails, whenever you auto-generate a project, (rails generate scaffold or what ever you actually use) it automatically inserts a line of code into your header.
One other grievance I had while doing this project is how handlebars and the chrome terminal don’t really work together. At least in my situation I realized in the terminal, if we go through the handlebars procedure, getting the template, compiling it, registering partials if necessary. If we go through the process, save a template with data and then but a debugger right after, the variable with the saved template after data has been fed to it, won’t really work. At least in my experience, it didn’t work all that well. And as a strong lover of binding.pry back in ruby, I’m a big fan of calling and running things in debugger to see what exact values I will be getting for each function or variable, before even letting my app fully run. After even more experimentation, I eventually just let my code run and push these templates into the DOM and it would work fine. But before this moment, in my stage of confusion as to why it would append the template with certain data undefined, I would try and call the data or even just the return variable in debugger. Because you are currently in debugger (and in my example, retrieving the template and compiling it outside of the current scope), I receive errors saying it doesn’t understand what object I am inserting or calling with my template. When the app freezes to work with debugger, it somehow understands the templates less. But if you retrieve/compile/runTemplate in the terminal, you will see a properly filled in template with your new data. Moral of the half story, when working with handlebars, don’t solely rely on debugger to call functions and see what will be retrieved. Sometimes, even if the code is buggy, pretty badly written, sometimes even if you’re not sure what will happen, just let it run.
But for an in depth look at my project, here is the github URL GITHUB - roommate_assistant