VFVahid Fazlollahzadeinen.vfsoraki.ir·May 6, 2021 · 2 min readShared templates between LiveView and static pagesEver wanted to share some templates between your LiveViews and other static pages? Footers/headers/sidebars and such parts of a website can be shared. Here is something to help you. You can define a view like this: defmodule YourAppWeb.SharedView do ...00
VFVahid Fazlollahzadeinen.vfsoraki.ir·Apr 22, 2021 · 3 min readA use-case for virtual fields in EctoEver wanted to show a list of items along with the number of another related item, e.g. show a list of posts with the number of comments? We can use Ecto virtual fields to achieve this. Consider a schema defined as: schema "posts" do # ... has_ma...00