Sinatra Portfolio Project

Users Table Structure
Paintings Table Structue
rake — tasks
  • The CRUD action for updating contains two methods. Below our get method sets the variable @painting to equal the painting object that is located by it’s id parameter and shows a view ‘paintings/show’.
  • The view then accesses the painting’s name using the table column ‘painting_name’ and exposes it to the user. The painting’s year follows the same convention.
  • Within the view above we have the ability to edit the painting, which is only available to users that are logged in — and to users that own the painting — by the logic written in the method below.
  • The user is then routed by selecting the edit painting button to the edit view below.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Mastering Karate in Five Steps — Step-3: Reading data files, Scenario Outline, CSV files, Callers

Top 50 Classic Data Structures Problems

TeraCrawler Demo

Framing the Platform-Ecosystem Space at the dawn of 2022

Delete Docker images filter by Name

Some Ways of Seeding Data in Ruby/Rails

Docker for Beginners

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


More from Medium


How to Successfully Market Yourself on LinkedIn

How To Give Your eCommerce Internet site A Master Stroke With WooCommerce

3–2–1 Choice, Money,