Chaya's Coding Journey


Pathway To A New Career

My Rails Project Utilizing Devise Gem with Admin Role and a Shopping Cart

It’s project time again at Flatiron School and it’s for Ruby on Rails. Rails is a web-application framework that includes everything needed to create a database-back web applications according to Model-View-Controller (MVC) framework. We were introduced to MVC back in the Sinatra section of the curriculum and Rails brings it to a full circle. This is my favorite section of the curriculum so far because it allows us to utilize what we’ve learned from the beginning into one framework.

I decided to build my project on my Sinatra project idea. To recap, my Sinatra project was called Cafe-Online-Ordering, which was a simple web application that lets users create, edit, and delete orders from a cafe menu. I’m building on this simple idea and adding new features such as a fully-functional cart, an admin role who can add new items to the menu, and the ability to login using a third-party authentication (OAuth) via GitHub. There are a few project requirements that needed to be met with this project regarding MVC.

  • Must include at least one has_many relationship
  • Must include at least one belongs_to relationship
  • Must include at least two has_many through relationships
  • Must include at least one many-to-many relationship
  • The “through” part of the has_many through includes at least one user submittable attribute, that is to say, some attribute other than its foreign keys that can be submitted by the app’s user

My Second Portfolio Project - Cafe Online Ordering

In my last post, I talked about possible project ideas. I ended going with a cafe order app. I created a cafe menu containing coffee drinks, tea drinks, and pastries. I wanted a few features, such like only someone who signed up for an account can create an order from the menu and the user has to be logged in to edit orders and can only edit and delete their own orders. Anyone can access the cafe menu but won’t be able to create an order unless an account is created. A user can create an account by providing a name, email and a password, while only an account can be created if the email is valid. This means an account can’t be created without a domain. I will go over a few of these things in my post. I was also able to deploy my app on Heroku, which is another separate process for that and I will add what I did to do so.


Starting My Sinatra Project

I still have a few more weeks before my Sinatra project so I have been thinking about a few ideas. I want to keep the theme I had with my CLI project that involves around food and restaurants. My CLI Data Gem project was about displaying restaurants and their attributes based on Yelp’s API data. For my Sinatra project, I want to create a web application that allows users to make online orders for a local coffee shop make/bakery.


Recap of what I've learned so far

It’s really awesome since I’ve started this program the different things we’ve learned and how they’re building on another. With Procedural Ruby, we learned how methods work and how to access elements in arrays and hashes. With Object-Oriented Ruby, we learned about classes and instances and how classes and objects relate to one another. With SQL, we learned about databases and how to query from them. It can be a little overwhelming to learn all these new things and to keep remembering how they are used.


Wrapped up my first project and started SQL

I finished my project and had my project assessment on October 29th. It went pretty well. Most of my refactoring was done during the live coding and was given one task to do afterwards. I had finished my project assessment early so it left me a few days to rest and refresh until the next deployment of lessons.