From 947e165f253125717011a434322403cbd08435d4 Mon Sep 17 00:00:00 2001 From: Joseph Dudley Date: Wed, 8 Apr 2020 11:08:18 +0100 Subject: [PATCH] Fixed bug with blank string links Addresses #253 Switched from `.nil?` to `.blank?` to catch empty strings as well as null values. --- app/views/offers/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/offers/show.html.erb b/app/views/offers/show.html.erb index d6d1e57..f25945f 100644 --- a/app/views/offers/show.html.erb +++ b/app/views/offers/show.html.erb @@ -23,8 +23,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 %>