As I look at the requirements list for this project, I am amazed that I was able to pull it all together. But, I also remembered that those who have gone before me did it, too. Wow, I finally made it to the end of this stage of learning. This project took me longer than I expected mostly because it combined so many different things that I had learned along the way. As I went through each of the lessons and labs for React and Redux, I understood those pieces of the puzzle individually. But putting it all together was a challenge. I chose a medications app as a way to bridge between my previous career as a medical assistant and my future career as a web developer. With this app, you can look at information on different medications and if you want, you can give a review which includes a rating and comment.
This is a continuation of my Rails project, just with some jQuery added to it, so the original models, etc. are all the same. A user can have many farms, farms have many areas, and areas have many animals. A farm also has many animals through areas. The first requirement that I did was to add an “on click” handler to a farm’s page to show a list, or index, of the farm’s animals within a div so the page would not need to be refreshed. At first I used a $.ajax request to do this because I was still trying to wrap my brain around the $.get. Listing the animals also revealed a “has-many,” or at least a “has-many, through” relationship to satisfy that requirement.
When I started my rails project I did the usual writing out what I wanted to do detailing the associations between the models/tables. This app idea comes from a need to keep track of the animals that we have on our property. We have 3 different types of animals in 4 different areas. So, for the app, I wanted a user to be able to have many farms. Each farm can have many areas and many animals through areas. To check it out on Heroku: https://farm-tracker.herokuapp.com/
As I have progressed through Rails lessons, I’ve noticed that there are lots of methods that are being used to do various things such as generating HTML for forms. Form helpers like form_tag and form_for help with building different forms. Sometimes I just start to use methods like this in the labs without completely understanding what they do, so I decided to review the information about them. The form_tag method allows for building a form without the need for a model or database table. The form_tag is for when you need a search field or a form that doesn’t save or update to the database.
This time around, I felt more prepared to do a project. I had just finished working on the last Sinatra labs and projects in the section, so I was much more comfortable with the idea of building a CRUD app. CRUD stands for Create, Read, Update, and Delete, which are the main functions that a CRUD app should be able to do. At first I was tempted to do something related to my favorite hobby, knitting, but I figured that was narrowing my potential user range. So I decided on a simple parts content management system which I have wanted to do for my husband’s small business. With this system, a user can sign up, or login if they’re a current user, and add parts to a simple sqlite3 database. Then, as the user needs to, they can add more parts, edit/update specifics for individual parts, and delete parts. It is built in a generic way so the parts could be for anything from auto parts to airplane parts to lawnmower parts, etc. As long as you have the name of the part, the serial number, manufacturer, and quantity that you have on hand, you can add a part to your database.