Git Product home page Git Product logo

curiosum-dev / curious_messenger Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 5.0 360 KB

Companion repository for Phoenix LiveView Messenger app by Curiosum.dev. Part 1: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-1?utm_source=github&utm_medium=social, Part 2: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-2?utm_source=github&utm_medium=social, Part 3: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-3?utm_source=github&utm_medium=social, Part 4: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-4?utm_source=github&utm_medium=social

Home Page: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-1

Elixir 75.10% CSS 13.04% JavaScript 6.79% HTML 5.07%
elixir phoenix-framework phoenix phoenix-liveview

curious_messenger's Introduction

curious_messenger's People

Contributors

vincentvanbush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

curious_messenger's Issues

Part 3 - Blog post missing code

First of all I want to say thanks for taking the time to write this series of Blog Posts :)

The blog post for part 3 doesn't mention that we need to add the plug assign_user.ex and to add to PageController the line:

plug CuriousMessengerWeb.AssignUser, preload: :conversations

Also the blog post mention that for conversation.ex we should add this code:

schema "chat_conversations" do
  # ...
  has_many :conversation_members, ConversationMember
  has_many :conversations, through: [:conversation_members, :conversation]
end

But in instead the repo have this code:

# ....
has_many :conversation_members, ConversationMember, on_replace: :delete
has_many :users, through: [:conversation_members, :user]

Without this we get an exception:

[error] #PID<0.788.0> running CuriousMessengerWeb.Endpoint (connection #PID<0.786.0>, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
    ** (Protocol.UndefinedError) protocol Enumerable not implemented for #Ecto.Association.NotLoaded<association :conversations is not loaded> of type Ecto.Association.NotLoaded (a struct). This protocol is implemented for the following type(s): Ecto.Adapters.SQL.Stream, Postgrex.Stream, DBConnection.PrepareStream, DBConnection.Stream, HashDict, Range, Stream, MapSet, Date.Range, GenEvent.Stream, HashSet, Map, List, File.Stream, Function, IO.Stream

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.