Elixir and Phoenix Commands for a Rails Developer

Created: April 16, 2019 01:25 | Updated: April 20, 2019 09:16
Tags: Elixir, Phoenix

New Mix Project

mix new project_name

New Phoenix Project

mix phx.new project_name

Install dependencies

(aka bundle)

mix depts.get

Hex will not install with

mix deps.get throwing an error after a timeout



(aka irb)

iex -S mix

Phoenix console

(aka rails console)

iex -S mix phx.server

Reload console

(aka reload!)


Scaffold resources

Example of videos with multimedia context

mix phx.gen.html Multimedia Video videos user_id:references:users url:string title:string description:text

Generate docs

Add dependency to mix.exs within the deps code block

{:ex_doc, "~> 0.20"}

Install dependencies

mix deps.get

Generate docs

mix docs

Written by Alan Vardy. Let me know how I can make this better!