Merge pull request #631 from Retrospring/answer-is-too-lo…
answerbox: use ActiveSupport's String#truncate
This commit is contained in:
commit
85d2ffc5ec
|
@ -5,9 +5,8 @@
|
||||||
.card-body
|
.card-body
|
||||||
- if display_all.nil?
|
- if display_all.nil?
|
||||||
.answerbox__answer-text
|
.answerbox__answer-text
|
||||||
= markdown a.content[0..640]
|
= markdown a.content.truncate(640, omission: " [...]", separator: /\s/)
|
||||||
- if a.content.length > 640
|
- if a.content.length > 640
|
||||||
[...]
|
|
||||||
%p
|
%p
|
||||||
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
|
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
|
||||||
= t(".read")
|
= t(".read")
|
||||||
|
|
Loading…
Reference in New Issue