dwyl / dwyl/phoenix-liveview-todo-list-tutorial

miscellaneous issues with phx 1.7.11

Open
#157 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elixir
Stars
71
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I wanted to thank you for such a great tutorial, I learn a lot from it!
I was using phoenix 1.7.11 and found some issues that are not described in the tutorial and might become an obstacle for a complete beginner

1. in Step 2.5 the link for css file was not working I had to go to [https://todomvc.com/examples/javascript-es6/dist/](https://todomvc.com/examples/javascript-es6/dist/) and found needed css file in the sources
2. in step 7 "Delete" a Todo item, since we are softly deleting items, I found useful to wrap list items in this block with conditional statement
```


    <%= for item <- @items do %>
    <%= if item.status != 2 do %>


  • <%= if checked?(item) do %>

    <% else %>

    <% end %>
    <%= item.text %>



  • <% end %>
    <% end %>

```
So we do not display deleted items

3. In Step 9(this was the biggest one, I'm using phoenix 1.7.11 and in new version `Phoenix.Router.Helpers` is disabled by default)
We need to change in LiveViewTodoWeb.router() to `Phoenix.Router, helpers: true`
Also to use `Router.Helpers` we need to alias it inside `LiveViewTodoWeb.live_component` and `LiveViewTodoWeb.live_view` like this `alias LiveViewTodoWeb.Router.Helpers, as: Routes`

That's all! With all other miscellaneous issues, the code deployed in this repo helps a lot
Thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.