Member-only story
My first challenge as a student of Flatiron was to create a command line application, CLI, using Sinatra and ActiveRecord to access an sqlite database. To use classes that held many associations, and give on fell CRUD capability.
My CLI idea was to create an application that allowed guests to create an account(create), browse movies(read), purchase tickets, sign in to view, or change information(update) as well as cancel a ticket or account(delete). Guests would be the class that had full CRUD capability.
I had my database tables setup and models with the proper associations which led me to start to think about the possibilities. I can see all of my instances and call on their belonged objects in a console session but how to let a guest interact with this data? Why would someone WANT to use this? I never made it to those quite yet because of, “How do I update a model?”
Using gems you’re able to answer the first few of those questions but the challenge came from allowing a user to update their models/account. I still had more cruddy stuff to figure out. Updating and deleting capabilities were my first challenge in this project that I had to overcome.
Updating a model presented me with a challenge. Updating a model in a CLI application requires the user, or guest in my application, to be signed in. How else would the application know…