diff --git a/app/controllers/embed_controller.rb b/app/controllers/embed_controller.rb index 260c0076de3..be4ef56a8dd 100644 --- a/app/controllers/embed_controller.rb +++ b/app/controllers/embed_controller.rb @@ -11,6 +11,7 @@ class EmbedController < ApplicationController if topic_id @topic_view = TopicView.new(topic_id, current_user, {best: 5}) + @second_post_url = "#{@topic_view.topic.url}/2" else Jobs.enqueue(:retrieve_topic, user_id: current_user.try(:id), embed_url: embed_url) render 'loading' diff --git a/app/views/embed/best.html.erb b/app/views/embed/best.html.erb index 6b8f38de3a6..162a3aeeed2 100644 --- a/app/views/embed/best.html.erb +++ b/app/views/embed/best.html.erb @@ -1,6 +1,6 @@
<%- if @topic_view.posts.present? %> - <%= link_to(I18n.t('embed.title'), @topic_view.topic.url, class: 'button', target: '_blank') %> + <%= link_to(I18n.t('embed.title'), @second_post_url, class: 'button', target: '_blank') %> <%- else %> <%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %> <%- end if %> @@ -22,7 +22,7 @@ <%- end %>