This project was to create a Rails app utilizing, among other things: an MVC structure, certain associations between models, and validations for attributes.
This project required creating a CRUD, MVC app using Ruby on Rails. A while ago, a friend posted on Facebook that her husband thought she had an app that told her which stores and restaurants had things like changing tables and family restrooms. He’d been out with their infant daughter and been frustrated that he didn’t know and didn’t have an easy way to find out. Other mothers replied to her post saying that it would be helpful for them too and that they couldn’t believe something like this didn’t already exist.
This is my first attempt at making that idea real. A user can log in, log out, create reviews of places - short comments, and choose the place the comment is about from a dynamic dropdown menu which will update as the list of places grows. A logged in user can view the list of places, and click on each one to go to its profile. From the list of places, a user can click on a link to create a new place if they don’t see the one they are looking for.
When a user creates a review, it will show up on their profile page in order of newest to oldest. These posts contain a link to the place the review is about as well as a link for the user who created it to delete it. Users can see places created by other users, and could click on a profile of another user to see that person’s reviews, but users cannot edit each other’s posts.
When I started this project, I was intimidated and frustrated because I still didn’t really understand how to use Rails. When we made the jump from Sinatra to Rails, it was very difficult for me to pick up on the new abstractions and syntax. When it came time to begin the project I still wasn’t sure how where to start, or how to manage the workflow. I was still unsure how to use the Rails generators, hadn’t deployed something to Heroku, and had never created or used branches in git.
A couple weeks prior I had sought out an additional resource to help me learn; in the past I had used the Head First: Ruby and Learn Ruby the Hard Way books. This time I found the Ruby on Rails Tutorial, by Michael Hartl. This helped get me through setting up my users and initial reviews pages, and from there I had digested enough to figure out the rest I managed to accomplish.
By the end of the time working on this project, I had become comfortable with using the generators, gotten my app up and running on Heroku, and created (probably too many) branches on Github. It became easier to think of things in chunks - get the users working, get the places working, connect the users and places - instead of being overwhelmed by trying to do everything at once.
During this process, even while using a book for guidance, I had to do not-infrequent debugging. I had to catch and correct syntax errors, figure out why references to some things weren’t working, and get comfortable reading the errors that Rails spit out in the browser. I also learned how to run the rails console in sandbox mode, so I could poke around and experiment without polluting my database. The tutorial walked through creating our own tests for things, which I also hadn’t done before because I was afraid to figure out how to do it. In the process of doing that, I learned how to use a gem to make the test results spit out in color - green or red. At some point I broke things and I was running out of time so I abandoned the tests, but I’d like to go back and write more.
I didn’t satisfy all of the specs because, ultimately, I didn’t figure out or understand how to complete them before the project was due. I’m still not sure I understand how to utilize nested routes, or what a class level Active Record scope method means, and I abandoned trying to create the ability to login using google after breaking things and running out of time. I will need to go back and do these things, and I would also like to go back and add things like letting users follow each other, account activation, and the ability for users to reset their password if they forget it and can’t login.
I only cried 3(ish!) times trying to get this done, partly from frustration and partly from exhaustion, so that’s progress. I still struggle to balance how much time I spend studying and when with working full time. It’s hard to get home and make myself focus for 3-4 hours after being drained from the work day. But, if I leave too much for the weekend, that’s not any better. When I did get things working, it was still really, really exciting. I’ve gotten better at googling what I need to do, scanning pages to see if they’re helpful, and copying/pasting what I think might work where I think it needs to be. It’s getting easier to make small changes and less frustrating to try again.
Making these things work, and learning as much as I can is still really, really important to me. Even when this is hard - and learning is hard! - it’s fun and it’s satisfying. It’s hard when it takes me longer to understand something than I think it should, or when I can’t finish something as quickly as I should. I’m learning that failure is not the end of the world and that learning as much as I can as quickly as I can is just going to be something I have to keep doing. Eventually things will stick.