diff --git a/app/controllers/employees_controller.rb b/app/controllers/employees_controller.rb index 0fccff1..9f00b4f 100644 --- a/app/controllers/employees_controller.rb +++ b/app/controllers/employees_controller.rb @@ -8,6 +8,7 @@ def index # GET /employees/1 or /employees/1.json def show + sleep 1 end # GET /employees/new diff --git a/app/views/employees/_employee.html.erb b/app/views/employees/_employee.html.erb index 8eb9ef0..0e5718e 100644 --- a/app/views/employees/_employee.html.erb +++ b/app/views/employees/_employee.html.erb @@ -1,4 +1,4 @@ -
+<%= turbo_frame_tag employee do %>

First name: <%= employee.first_name %> @@ -28,5 +28,4 @@ Email: <%= employee.email %>

- -
+<% end %> diff --git a/app/views/employees/index.html.erb b/app/views/employees/index.html.erb index 83b1cfe..fd445ba 100644 --- a/app/views/employees/index.html.erb +++ b/app/views/employees/index.html.erb @@ -4,10 +4,12 @@
<% @employees.each do |employee| %> - <%= render employee %> -

- <%= link_to "Show this employee", employee %> -

+ <%= turbo_frame_tag employee, loading: :lazy, src: employee_path(employee) do %> +
+ Loading... +
+ <% end %> +
<% end %>