diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index df98fdb72..23ab36a32 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -10,7 +10,7 @@ class DebatesController < ApplicationController else @debates = Debate.all.order("created_at DESC") end - @featured_debates = [] + @featured_debates = @debates.to_a.shift(3) end def show diff --git a/app/views/debates/_featured_debate.html.erb b/app/views/debates/_featured_debate.html.erb new file mode 100644 index 000000000..6f74b0ed7 --- /dev/null +++ b/app/views/debates/_featured_debate.html.erb @@ -0,0 +1,41 @@ +
+ <%= pluralize(featured_debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %> +
+<%= sanitize(truncate(featured_debate.description, length: 200).html_safe) %>
+<%= render "shared/tags", debate: featured_debate %>
+- <%= pluralize(debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %> -
-<%= sanitize(truncate(debate.description, length: 200).html_safe) %>
-<%= render "shared/tags", debate: debate %>
-