<div class="card my-1 w-100">
  <%= link_to travel_path(travel.format_id) do %>
    <%= image_tag travel.image_public_url, class: 'card-img-top' %>
  <% end %>

  <div class="card-body">
    <h5 class="card-title">
      <%= travel.title %>
    </h5>

    <p class="card-text">
      <%= travel.description %>
    </p>
  </div>

  <div class="d-flex flex-row-reverse travel-buttons">
    <% comment_class = 'active' if user.comment?(travel) %>

    <button type="button" class="btn btn-comment btn-link no-decoration <%= comment_class %>">
      <i class="far fa-fw fa-comment"></i>
      <i class="fas fa-fw fa-comment"></i>
      <%= travel.comments.count %>
    </button>

    <% favorite_class = 'active' if user.favorite?(travel) %>

    <button type="button" class="btn btn-favorite btn-link no-decoration <%= favorite_class %>">
      <i class="far fa-fw fa-star"></i>
      <i class="fas fa-fw fa-star"></i>
      <%= travel.favorites.count %>
    </button>
  </div>
</div>

<div class="card my-1 w-100">
  <%= link_to travel_path(travel.format_id) do %>
    <%= image_tag travel.image_public_url, class: 'card-img-top' %>
  <% end %>

  <div class="card-body">
    <h5 class="card-title">
      <%= travel.title %>
    </h5>

    <p class="card-text">
      <%= travel.description %>
    </p>
  </div>

  <div class="d-flex flex-row-reverse travel-buttons">
    <% comment_class = 'active' if user.comment?(travel) %>

    <%= link_to travel_path(travel.format_id), class: "btn btn-favorite btn-link no-decoration active #{comment_class}" do %>
      <i class="far fa-fw fa-comment"></i>
      <i class="fas fa-fw fa-comment"></i>
      <%= travel.comments.count %>
    <% end %>

    <% if current_user.favorite?(travel) %>
      <%= button_to travel_favorites_path(travel_id: travel.format_id), method: :delete, class: 'btn btn-favorite btn-link no-decoration active' do %>
          <i class="far fa-fw fa-star"></i>
          <i class="fas fa-fw fa-star"></i>
          <%= travel.favorites.count %>
      <% end %>
    <% else %>
      <%= button_to travel_favorites_path(travel_id: travel.format_id), class: "btn btn-favorite btn-link no-decoration" do %>
          <i class="far fa-fw fa-star"></i>
          <i class="fas fa-fw fa-star"></i>
          <%= travel.favorites.count %>
      <% end %>
    <% end %>
  </div>
</div>

Fix favorite button in home
Fix favorite button in home