LoginSignup
11
3

リハビリアプリを作ろう(その1)

Posted at

1-25の数字押していくゲームを作りたいです
このコラムの範囲

  • プロジェクトの作成
  • 空白のページを作成

少しづつ作ります

プロジェクト作成

mix phx.new num --no-ecto
cd num
mix phx.gen.live Users User users name:string

ルータ設定

num/lib/num_web/router.ex
 scope "/", NumWeb do
    pipe_through :browser

+    live "/users", UserLive.Index, :index
    get "/", PageController, :home
  end

不要なファイルを削除

lib/num/users/user.ex
lib/num/users.ex

lib/num_web/live/user_live/form_component.ex
lib/num_web/live/user_live/show.ex
lib/num_web/live/user_live/show.html.heex

上書きする

lib/num_web/live/user_live/index.ex
defmodule NumWeb.UserLive.Index do
  use NumWeb, :live_view

  @impl true
  def mount(_params, _session, socket) do
    {:ok, socket}
  end

end
lib/num_web/live/user_live/index.html.heex
test

現時点結果

image.png

今回はここまで

11
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
3