Skip to content

Commit

Permalink
feat: disable ability to subscribe to same plan from homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
castrolem committed Oct 15, 2019
1 parent 79f5ac7 commit 6c1e492
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
</h3>
<h4><%= plan.headline %></h4>
<%= plan.description %>
<p><%= link_to 'Subscribe', @current_user ? new_subscription_charge_path(plan_id: plan) : login_path %></p>
<% if @current_user&.active_subscription&.plan.id == plan.id %>
<p>Subscribed</p>
<% else %>
<p><%= link_to 'Subscribe', @current_user ? new_subscription_charge_path(plan_id: plan) : login_path %></p>
<% end %>
</div>
<% end %>
<div class="subscription--plan" id="one-time-donation">
Expand Down

0 comments on commit 6c1e492

Please sign in to comment.