Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug with blank string links
Browse files Browse the repository at this point in the history
Addresses #253

Switched from `.nil?` to `.blank?` to catch empty strings as well as null values.
  • Loading branch information
jdudley1123 committed Apr 8, 2020
1 parent 124a5db commit 947e165
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/offers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

<div class="mb-8">
<% if current_user.is_project_member?(@project, %w[contributor mentor]) %>
<% link = @offer.sign_up_link || project_offer_book_path(@project, @offer) %>
<% link_id = @offer.sign_up_link.nil? ? 'email-support' : 'external-support' %>
<% link = @offer.sign_up_link.blank? ? project_offer_book_path(@project, @offer) : @offer.sign_up_link %>
<% link_id = @offer.sign_up_link.blank? ? 'email-support' : 'external-support' %>
<%= link_to 'Book your place', link, class: 'btn bg-orange-500 hover:bg-orange-600 text-white ', id: link_id %>
<% end %>
</div>
Expand Down

0 comments on commit 947e165

Please sign in to comment.