I just finished the sinatra project and boy does it feel good. It’s so nice to get to see that all the work that I’m putting in is really turning out to be something. I started this project by trying to come for an idea for ssomething that would work for this. To get some inspiration I decided to go outside for a walk. As I was walking something caught my eye and I was like I should do something about that. It was a car. I tried to think what could I make with my new knowledge of sinatra that had to do with cars. I threw around a few ideas and I decided the best way to go would be to just make a web app that could keep track of someones cars. So there I was starting the project. I took alot of the structure from other things that I had done previously so that was not that hard to set up. Next I started to build out the functionality of the app. I put in a controller for users and set up the users with a username and secure password. The next thing was getting the car part to work. I ran into issues because I was having the users after they sign up go straght to their list of cars but they weren’t putting in a car when they signed up. So I changed that it wouldn’t break if you didn’t put in a car. I also made it that in order to sign up you need to add a car to the database first. The last step was getting the index page to work because fro some reason it wasn’t listin all the cars. I got some help for this and realized that I was searching for them wrong. I was looking through cars using th find_by method which just returns a single instance and not an array. This was the wrong way to look for it because I needed an array so I’d be able to iterate through it on the index page. I fixed this by finding cars based on the user because the user has many cars and then that worked fine. The last thing I did was add flash messages that way when you interact with the site you would know what’s going on. I was told me about this and showed the sinatra flash message options. I added a few messages in different places and then i was good to go.
The next step in my coding journey was continuing sinatra. While I was in middle of doing it I took off for a week. This was great to really get a break from the intensity of learning so much so quickly. What I learnt though as soon as I started again was that learning quickly sometimes means forgetting quickly too. So I had to really go back and review. Now I’m up to sessions and log ins in Sinatra. These didn’t seem hard when i started doing them but kept getting harder as I moved along. As it progressed it took some time to get the information that i needed to know and know where to apply it. Having the information is a step but knowing where to apply became the hard part. With this it took a bunch of long hard steps to get through it but thankfully it’s working. Now I’m up to using Active Record with sinatra. This is a challenge because each one of these is hard in it’s own right and putting them together just makes it more complicated. The nice thing about it is that now I can see how what I’m learning can really help do things. The hardest part for me though is now that it’s that much more complicated there’s so much more room for mistakes. But this is really pushing me to get better and go back and review what I’ve learnt until now and make sure I really know it.
So continuing from my last post where i wrote about my cli project it was really great to get that done and see what i could do. The next step was learning active record. What was fascinating about that was that i was able to see how by just working with this I could do everything I had learnt without having to code it myself. The next step in the course was learning HTML. This is totally different then what i had been doing with ruby because ruby is all logic and methods but HTML just sets things up on the page without any logic but just styling and you just tell it where to put what. So when i first started coding I learnt HTML and i found it fascinating but now it lost its luster becuase after getting ruby to do things it just wasn’t the same. It felt so tedious to just style something and not provide logic. Thankfully I was able to get through this. The next step was learning css which can do some pretty cool stuff. But it was still so tedious to do it because even though what it does is cool it’s very similar to HTML in the sense that it doesn’t use logic and it just does what you tell it to do. Now this was even harder for me becuase I’m not that good at things like this that you nedd to keep trying and testing to see if it works the way I want it to. But thankfully i got through this and I was able to move on to the next part.
So, as the project started, I was looking for a website that would meet the requirements of what needed to be done. I was looking for something that I could scrape data from and then take it to the next level and give some info about it. I also wanted something that interests me. So I figured I would go with something historic, because I enjoy learning about history. I also was looking for a website that would fit the details of what needed to be done for the assignment and wouldn’t get to complicated.
As I learn programming, I find it so interesting that programming languages are called such, as they really mirror the way in which we speak. When I first started learning basic methods, I saw how you can manipulate little pieces of data. For example, when I learnt how to do “puts” and do some math it’s like learning how to read. When you learn the letter “A”, you can point it out in a word and see how it fits into the big picture. You can see - there’s a word that starts with an “A” and there’s another word that has an “A” inside of it. In programming, it’s like having a string; you can see what it starts with and what it ends with, and you can turn it around and count it. This is all really cool when you learn it, but you quickly realize that as cool as it is, it’s really limited in what it can do.