Listing Posts

<%= if @live_action in [:new, :edit] do %> <.modal return_to={Routes.post_index_path(@socket, :index)}> <.live_component current_user={@current_user} module={AggieditWeb.PostLive.FormComponent} id={@post.id || :new} title={@page_title} action={@live_action} post={@post} return_to={Routes.post_index_path(@socket, :index)} /> <% end %> <%= for post <- @posts do %> <% end %>
Title Body
<%= post.title %> <%= post.body %> <%= live_redirect "Show", to: Routes.post_show_path(@socket, :show, post) %> <%= live_patch "Edit", to: Routes.post_index_path(@socket, :edit, post) %> <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: post.id, data: [confirm: "Are you sure?"] %>
<%= live_patch "New Post", to: Routes.post_index_path(@socket, :new) %>