Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us
Notesclub

Blog: Comments

exercises/blog_comments.livemd

Blog: Comments

Mix.install([
  {:jason, "~> 1.4"},
  {:kino, "~> 0.9", override: true},
  {:youtube, github: "brooklinjazz/youtube"},
  {:hidden_cell, github: "brooklinjazz/hidden_cell"}
])

Navigation

Home Report An Issue One-To-Many AssociationsPhoenix Authentication

Blog: Comments

You’re going to create a comments for blog posts on your existing Blog project.

erDiagram

Comment {
  text content
  id post_id
}

Requirements

  • Migration & Schema
    • Create a comments table with a content field of type :text.
    • Posts should have many comments (one-to-many), and comments should belong to a post.
  • Functionality
    • Display comments on each post
    • Create a comment for a post through a form on the post show page.
    • (Bonus): Delete Comments
    • (Bonus): Edit Comments
  • Tests
    • Write Context and Controller tests to ensure the post page displays comments on the post.
    • Write Context and Controller tests to ensure a comment can be created for a given post.
    • All tests should pass. You may need to modify old tests to ensure they continue to pass.

Commit Your Progress

DockYard Academy now recommends you use the latest Release rather than forking or cloning our repository.

Run git status to ensure there are no undesirable changes. Then run the following in your command line from the curriculum folder to commit your progress.

$ git add .
$ git commit -m "finish Blog: Comments exercise"
$ git push

We’re proud to offer our open-source curriculum free of charge for anyone to learn from at their own pace.

We also offer a paid course where you can learn from an instructor alongside a cohort of your peers. We will accept applications for the June-August 2023 cohort soon.

Navigation

Home Report An Issue One-To-Many AssociationsPhoenix Authentication