diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 39b295d..bd9b4f2 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -12,31 +12,37 @@ - - - Name - Last Heard - Led Status - Actions - - <% @devices.each do |d| %> + <% if @devices.present? %> + - <%= d.attributes[:name] %> - <%= d.attributes[:last_heard] %> - - <% if d.attributes[:led_status] == 1 %> - On - <% else %> - Off - <% end %> - - - - <%= button_to 'Toggle Led', pages_toggle_led_path, method: :post, params: { device_name: d.attributes[:name] }, class: "button is-warning" %> - - + Name + Last Heard + Led Status + Actions - <% end %> - + <% @devices.each do |d| %> + + <%= d.attributes[:name] %> + <%= d.attributes[:last_heard] %> + + <% if d.attributes[:led_status] == 1 %> + On + <% else %> + Off + <% end %> + + + + <%= button_to 'Toggle Led', pages_toggle_led_path, method: :post, params: { device_name: d.attributes[:name] }, class: "button is-warning" %> + + + + <% end %> + + <% else %> + + There are no devices online at this time. + + <% end %>