Elixir and Phoenix Commands for a Rails Developer

2019-04-16

Alan Vardy
 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

HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get

Console

(aka irb)

iex -S mix

Phoenix console

(aka rails console)

iex -S mix phx.server

Reload console

(aka reload!)

recompile

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
Like what you see?

Related Posts