Last Updated: December 09, 2021
·
138
· dfang

quick tip for iex in phoenix project

when you're developing in a phoenix project, you may need to use console (iex -S mix) to try something ecto query like rails console, you can create a file (.iex.exs) in project folder. and puts something like this in that file.

import Ecto.{Query, Changeset}
alias Pragmatic.Repo
alias Pragmatic.Items.Item

then in console, you don't need to type full path.