當試圖運行mix ecto.create我得到了以下錯誤: .Repo couldn't be created: tcp connect: connection refused - :econnrefused .Repo couldn't be created: FATAL (invalid_authorization_specification): role "postgres" does no
我遵循phoenix框架的指導,在windows 10本地機器下創建一個簡單的應用程序。 the database hello_phoenix.repo couldn't be created:command timed out 通過運行混合phoenix.server我得到進一步的錯誤 Brunch 2+ requires node.js v4 or higher..... :所有甚至正在創建e
我想實現一些驗證的模型,只有當兩個字段爲模型呈現。 就像是: if Changeset.get_field(changeset, :field_a) or Changeset.get_field(changeset, :field_b) do
changeset
|> a_lot_of_validations
else
changeset
end
的問題是:當
我有這樣的代碼在我new.eex: <%= if Enum.any?(@changeset.errors) do %>
<%= rendering_code_is_here %>
<% end %>
是if總是會因爲我的變更也是如此,這個問題的代碼: def changeset(struct, params) do
struct
|> cast(bla-bla)