-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a user #7
Comments
Hi @idkjs! You should be able to create a user through the browser like this:
|
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. |
@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 |
Hi again! You need to checkout the |
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. |
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:
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. |
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 . |
Hi folks/ @SophieDeBenedetto. Thank you for sharing this.
I am an elixir beginner. Is there an instruction somewhere on how to create a user in the console? Can't seem to find it.
Thank you.
The text was updated successfully, but these errors were encountered: