Blog: Tags
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 Book Search: TagsBook Search: Book ContentBlog Tags
You’re going to add Tags to your existing Blog project.
Each blog post has a many-to-many association with tags.
Tags should have :name field describing the type of tag such as "tutorial", "elixir", "testing", etc.
classDiagram
class Tag {
name: :string
}
Blogs and tags should be associated through a join table blog_tags.
classDiagram
class BlogTag {
blog_id: :id
tag_id: :id
}
Tag Requirements
Ensure you:
- Can perform standard CRUD operations for tags.
- Can associate a blog with a tag using a multiple select when you create or update a blog.
- Include a list of a blog’s tags on the blog show page.
Bonus: Search By Tag
Add the ability to see posts for a particular tag.
For example, you might include a show blogs by tag page which displays all blogs that belong to a specified tag on the "/blogs/tags/:id route where :id is the id of a tag.
Alternatively, you might create a form on the book index page to search for blogs by tag.
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: Tags 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.