Portfolio: Images
Mix.install([
{:kino, github: "livebook-dev/kino", override: true},
{:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
{:vega_lite, "~> 0.1.4"},
{:kino_vega_lite, "~> 0.1.1"},
{:benchee, "~> 0.1"},
{:ecto, "~> 3.7"},
{:math, "~> 0.7.0"},
{:faker, "~> 0.17.0"},
{:utils, path: "utils"}
])
Navigation
Images
To learn more about one-to-one relationships You’re going to add images to blogs in your portfolio project.
- Images belong to a Blog.
- Blogs can have one image.
Each Image
record should have a :blog_id
foreign key and a :url
field.
classDiagram
class Image {
blog_id: :id
url: :string
}
Image Requirements
Ensure you:
- Can create an associated image from the blog create page using a form with a text input.
-
Display the image on the blog show page using an
html tag.
You do not need to handle uploading images, only storing the text URL of an existing image.
Bonus: Update Image
Add the ability to update blog images.
Ensure you:
- Can update an associated image from the blog create page using a form with a text input.
Commit Your Progress
Run the following in your command line from the project folder to track and save your progress in a Git commit.
$ git add .
$ git commit -m "finish portfolio blog images exercise"