From 75d237f091a79a79de615333ad596434b4b084be Mon Sep 17 00:00:00 2001 From: Nushrat Khan Date: Tue, 19 Jul 2016 11:10:12 -0400 Subject: [PATCH] truncate and toggle best bets description --- .../layouts/quick_search/_best_bets.html.erb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/quick_search/_best_bets.html.erb b/app/views/layouts/quick_search/_best_bets.html.erb index bda4689..d89ae0b 100644 --- a/app/views/layouts/quick_search/_best_bets.html.erb +++ b/app/views/layouts/quick_search/_best_bets.html.erb @@ -11,7 +11,21 @@ <% end %> Best Bet -

<%= best_bets[:description] %>

+ +

+ <% if best_bets[:description].length > 200 %> + <%= truncate(best_bets[:description], length: 200) %> + <%= link_to 'Read more', '', class: "read-more" %> + + <% else %> + <%= best_bets[:description] %> + <% end %> +

<% end %>