Comments (7)
If I recall correctly the tutorial branch has the starting state of the code for the blog post walk-through. Per this line from the blog post:
The starting state of the tutorial branch includes the chat domain model, routes, controller and the initial state of the LiveView, described below
You will find some completed code in the tutorial branch that takes care of the initial state of the app for the blog post. Then, the blog post walks you through adding additional features.
from live-view-chat.
Hi @idkjs! You should be able to create a user through the browser like this:
- start the server with
mix phx.server
- Visit the
/users/new
route - Fill out the registration form and sign up!
from live-view-chat.
Tried that. I get a browser error asking me to run migrations which doesn't work. I am afk and will try to get you a better error ASAP. Thank you.
from live-view-chat.
@SophieDeBenedetto thank you. That helped and I see it was mentioned in #1 .
The readme says that the seed should have created some chats and users though it seems like it doesnt do anything.
This is the seed file:
# Script for populating the database. You can run it as:
#
# mix run priv/repo/seeds.exs
#
# Inside the script, you can read and write to any of your
# repositories directly:
#
# Chat.Repo.insert!(%Chat.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
Here is the chats link in the browser.
I feel like i'm missing something since the code in tutorial branch doesnt seem to match what is in the tutorial. Am I missing something?
Thanks again for taking the time to teach.
Here is the terminal history if it helps: https://gist.github.com/idkjs/7ad9ecf509e3fa1933976a7e6270cea9
from live-view-chat.
Hi again! You need to checkout the tutorial
branch and work off of that. You can see that the seed file in the tutorial
branch is populated https://github.com/elixirschool/live-view-chat/blob/tutorial/priv/repo/seeds.exs
from live-view-chat.
Thanks. I kinda gave up on the tutorial branch because I didnt understand what we were supposed to be following along with. Is the tutorial branch a start position?
For example, the first step in the blog is
# lib/phat_web/controllers/chat_controller.ex
defmodule PhatWeb.ChatController do
use PhatWeb, :controller
alias Phat.Chats
alias Phoenix.LiveView
alias PhatWeb.ChatLiveView
def show(conn, %{"id" => chat_id}) do
chat = Chats.get_chat(chat_id)
LiveView.Controller.live_render(
conn,
ChatLiveView,
session: %{chat: chat, current_user: conn.assigns.current_user}
)
end
end
Then I see in the tutorial branch, that file has the following content:
live-view-chat/lib/phat_web/controllers/chat_controller.ex
Lines 1 to 35 in e3572c8
So it looks its already been done or this has more code in it then your blog? Idk. What are we supposed to do here if we are following along.
Probably me. Any guidance would be appreciated. Thank you.
from live-view-chat.
Ok. Thank you. Given my inexperience with elixir, I did not know what to make of that line. I saw it but was guessing as to what exactly it affected. I will look at it again and try to think through more carefully. Thank you for taking the time, @SophieDeBenedetto .
from live-view-chat.
Related Issues (5)
- Some (optional) changes HOT 1
- did this work on an earlier version of liveview? HOT 6
- License HOT 1
- Link to the blog post? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-view-chat.