<p id="notice"><%= notice %></p>

<h1>Listing Food Trucks</h1>

<% @food_trucks.each do |food_truck| %>
  <h3><%= link_to food_truck.name, food_truck%></h3>
  <span class="stars pull-right"><%= food_truck.rating %></span>
  <p><%= food_truck.intersection %></p>
  <% unless food_truck.phone == "0" %>
    <a href="tel:<%= food_truck.phone %>">
      <p><%= number_to_phone food_truck.phone, area_code: true %></p>
    </a>
  <% end %>
  <p><%= food_truck.genres %></p>
  <% if current_user.admin %>
    <%= link_to 'Show', food_truck %> |
    <%= link_to 'Edit', edit_food_truck_path(food_truck) %> |
    <%= link_to 'Delete', food_truck, method: :delete, data: { confirm: 'Are you sure?' } %>
  <% end %>
  <hr/>
<% end %>

<br>

<%= link_to 'New Food truck', new_food_truck_path %>

<p id="notice"><%= notice %></p>

<h1>Listing Food Trucks</h1>

<% @food_trucks.each do |food_truck| %>
  <h3><%= link_to food_truck.name, food_truck%></h3>
  <span class="stars pull-right"><%= food_truck.rating %></span>
  <p><%= food_truck.intersection %></p>
  <% unless food_truck.phone == "0" %>
    <a href="tel:<%= food_truck.phone %>">
      <p><%= number_to_phone food_truck.phone, area_code: true %></p>
    </a>
  <% end %>
  <p><%= food_truck.genres %></p>
  <% if user_signed_in? && current_user.admin %>
    <%= link_to 'Show', food_truck %> |
    <%= link_to 'Edit', edit_food_truck_path(food_truck) %> |
    <%= link_to 'Delete', food_truck, method: :delete, data: { confirm: 'Are you sure?' } %>
  <% end %>
  <hr/>
<% end %>

<br>

<%= link_to 'New Food truck', new_food_truck_path %>

Fix error when logged out
Fix error when logged out
