From 9d7e396b97879096fdac157a12716969e7bc0f14 Mon Sep 17 00:00:00 2001 From: lettergram Date: Sat, 25 Mar 2023 16:02:07 -0500 Subject: [PATCH] add affiliate link --- app/controllers/organizations_controller.rb | 2 ++ app/views/organizations/show.html.erb | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 32962de..9319f8a 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -33,6 +33,8 @@ def show @letters.group(:target_level).count) @letters_by_type = @letters.count + + @affiliate_link = request.base_url+'?referral_org_id='+@organization.id.to_s end diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index b9d049e..ec87332 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -58,9 +58,13 @@
- <% if current_user.org_admin or current_user.admin %> - <%= link_to 'Edit Organization Settings', edit_organization_path(@organization) %> - <% end %> + + Affiliate Link
+ <%= link_to @affiliate_link, @affiliate_link %>

+ <% if current_user.org_admin or current_user.admin %> + <%= link_to 'Edit Organization Settings', edit_organization_path(@organization) %> + <% end %> +