I've Phoenix app (I created it with --api flag) that has some additional data required to process requests that I store in priv/data/filters.csv. So it works fine in dev mode, I can read this file like: File.stream!("priv/data/filters.csv"), but once app is delivered using mix edeliver update this file is not accessible anymore. I can see this folder in build directory, but after app is delivered
On the Rails app, we can print the record count of a database table by a command like this: rails r "puts User.count" With my knowledge, if we want the same thing on the Phoenix/Ecto environment, we should run such a command: mix run -e "IO.puts SampleApp.Repo.aggregate(SampleApp.User, :count, :id)" That is OK, but is too lengthy for a daily usage. Is there any shorter way?
On my post model, I have implemented a simple validation def changeset(model, params \\ :empty) do model |> cast(params, @required_fields, @optional_fields) |> validate_length(:content, min: 2) |> validate_length(:content, max: 500) end On submitting the Post create form the view, I would like to show errors if there was something wrong from user submission, here is the view that renders the error
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く