ロジックに基づいてコントローラに「停止/ 1」がありますが、プラグにはありません。悲しいことに、それはリダイレクトしますが、リダイレクト後にコードを実行します。'halt'(Plug.Conn.halt/1)は、コントローラーのリダイレクト後にコールチェーンを停止しません。
if true do
conn
|> put_flash(:error, "Sorry, entered wrong")
|> redirect(to: route_path(conn, :show, model))
|> halt #this does not work :(
else
_ #something
end
update_another_model() #this is executed
render(conn, "abc.html", model: model) #even this is executed
私は実際にリダイレクト、任意のアイデアの後に終了する呼び出しが必要ですか?
悲しいことに、返信はありません – Devaroop