It works like magic.

Xiaochen Xu
1 min readJul 20, 2021

But you have to wire it up right, and that’s the hard part when it comes to rails.

To be honest, setting up a rails app, with all the models, associations, validations, migrations, authentications, authorizations, schema, etc. can be very confusing and daunting. I felt like I was navigating through a mine field, praying that my API returns clean data and works like charm without throwing big red error messages at my screen.

Thankfully it all worked. I feel like typo was such a pain for me. I get the grand idea of things, but sometimes, a little colon, a comma, a missing “s” at the end of a word, can take me a looong time to debug, and once I found the mistake, the overwhelming joy is hard to put into words.

Another thing that gave me trouble was useHistory in the front-end with React, somehow it was just giving me a hooks error and I was trying everything and researching the error for hours. Finally, I saw someone said you can also grab history from props, and I just threw in a console log within the App component. The moment I saw history show up at the console in my browser, I almost cried. And after that, my app worked like a charm.

I guess the most important lesson is really never give up, keep researching and reaching out for help.

--

--