Build a plain simple Ecto app step-by-step

create a new project

#validations #constraints

Project

create struct

make schema

Validations?

use changeset

create changeset for update

1
2
3
4
5
6
def print_hi(name)
  puts "Hi, #{name}"
  end
  print_hi('Tom')
  #=> prints 'Hi, Tom' to STDOUT.
  
1
2
3
4
5
class Base
  def two
    1 + 1
  end
end
class Base
  def two
    1 + 1
  end
end
defmodule Foo.Bar do
  def three do
    1 + two()
  end

  defp two do
    2
  end

end