Files
todoapp/app/views/todos/index.html.erb
2024-07-28 18:56:44 +02:00

22 lines
709 B
Plaintext

<div class="w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<% content_for :title, "Todos" %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Todos</h1>
<%= link_to "New todo", new_todo_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
</div>
<div id="todos" class="min-w-full">
<% @todos.each do |todo| %>
<%= render todo %>
<p>
<%= link_to "Show this todo", todo, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
</p>
<% end %>
</div>
</div>