Listing Properties

<%= if @live_action in [:new, :edit] do %> <%= live_modal @socket, Bones73kWeb.PropertyLive.FormComponent, id: @property.id || :new, title: @page_title, action: @live_action, property: @property, current_user: @current_user, return_to: Routes.property_index_path(@socket, :index) %> <% end %> <%= for property <- @properties do %> <% end %>
Name Price Description
<%= property.name %> <%= property.price %> <%= property.description %> <%= if Roles.can?(@current_user, property, :show) do %> <%= live_redirect "Show", to: Routes.property_show_path(@socket, :show, property) %> <% end %> <%= if Roles.can?(@current_user, property, :edit) do %> <%= live_patch "Edit", to: Routes.property_index_path(@socket, :edit, property) %> <% end %> <%= if Roles.can?(@current_user, property, :delete) do %> <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: property.id, data: [confirm: "Are you sure?"] %> <% end %>
<%= live_patch "New Property", to: Routes.property_index_path(@socket, :new) %>