From 831ca1dd6740c22b92ca6720ecf4bc520c3dc422 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Thu, 14 Dec 2017 13:50:42 +0100 Subject: [PATCH] Redirect anonymous user to sign in on create topic link --- app/helpers/communities_helper.rb | 3 +++ app/views/communities/show.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/communities_helper.rb b/app/helpers/communities_helper.rb index 22bc76617..744749a68 100644 --- a/app/helpers/communities_helper.rb +++ b/app/helpers/communities_helper.rb @@ -32,4 +32,7 @@ module CommunitiesHelper community.from_proposal? ? t("community.sidebar.description.proposal") : t("community.sidebar.description.investment") end + def create_topic_link(community) + current_user.present? ? new_community_topic_path(community.id) : new_user_session_path + end end diff --git a/app/views/communities/show.html.erb b/app/views/communities/show.html.erb index 59fa73646..4da0369b9 100644 --- a/app/views/communities/show.html.erb +++ b/app/views/communities/show.html.erb @@ -17,7 +17,7 @@
@@ -30,7 +30,7 @@